Fixed app building issues

This commit is contained in:
frikky
2020-09-05 09:22:50 +02:00
parent 2633ff4b4d
commit b1eb0f5a08
6 changed files with 14 additions and 11 deletions
+1 -1
View File
@@ -5,9 +5,9 @@ VERSION=0.6.0
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
docker build . -t frikky/shuffle:$NAME -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/app_sdk:0.6.0
#docker push frikky/shuffle:$NAME
#docker push frikky/$NAME:$VERSION
#docker push docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION
#docker push ghcr.io/frikky/$NAME:$VERSION
docker push frikky/shuffle:$NAME
docker push ghcr.io/frikky/$NAME:$VERSION
+3 -3
View File
@@ -6155,7 +6155,7 @@ func createFs(basepath, pathname string) (billy.Filesystem, error) {
}
// Hotloads new apps from a folder
func handleAppHotload(location string) error {
func handleAppHotload(location string, forceUpdate bool) error {
basepath := "base"
fs, err := createFs(basepath, location)
if err != nil {
@@ -6172,7 +6172,7 @@ func handleAppHotload(location string) error {
}
//log.Printf("Reading app folder: %#v", dir)
err = iterateAppGithubFolders(fs, dir, "", "", false)
err = iterateAppGithubFolders(fs, dir, "", "", forceUpdate)
if err != nil {
log.Printf("Err: %s", err)
return err
@@ -6394,7 +6394,7 @@ func runInit(ctx context.Context) {
// Hotloads locally
location := os.Getenv("SHUFFLE_APP_HOTLOAD_FOLDER")
if len(location) != 0 {
handleAppHotload(location)
handleAppHotload(location, false)
}
}
+1 -1
View File
@@ -4313,7 +4313,7 @@ func handleAppHotloadRequest(resp http.ResponseWriter, request *http.Request) {
}
log.Printf("Hotloading from %s", location)
err = handleAppHotload(location)
err = handleAppHotload(location, true)
if err != nil {
resp.WriteHeader(500)
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Failed loading apps: %s"}`)))