minor fixes to serve/build

This commit is contained in:
Lea Anthony
2019-02-13 08:44:53 +11:00
parent 9694dc57aa
commit 5994eb605f
5 changed files with 8 additions and 5 deletions

View File

@@ -188,7 +188,7 @@ function startBridge() {
// Call back
case "c":
var callbackData = message.data.slice(1);
log("Callback = " + callbackData);
window.wailsbridge.log("Callback = " + callbackData);
window.wails._.callback(callbackData);
break;
}

View File

@@ -11,7 +11,7 @@ export default {
// Passes the main Wails object to the callback if given.
Start: function(callback) {
if (callback) {
callback();
window.wails.events.on("wails:ready", callback);
}
}
};

View File

@@ -134,7 +134,7 @@ func CheckPackr() (err error) {
}
// InstallFrontendDeps attempts to install the frontend dependencies based on the given options
func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forceRebuild bool) error {
func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forceRebuild bool, caller string) error {
// Install frontend deps
err := os.Chdir(projectOptions.FrontEnd.Dir)
@@ -189,6 +189,9 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
}
bridgeFile := "wailsbridge.prod.js"
if caller == "serve" {
bridgeFile = "wailsbridge.js"
}
// Copy bridge to project
_, filename, _, _ := runtime.Caller(1)

View File

@@ -70,7 +70,7 @@ func init() {
// Install deps
if projectOptions.FrontEnd != nil {
err = cmd.InstallFrontendDeps(projectDir, projectOptions, forceRebuild)
err = cmd.InstallFrontendDeps(projectDir, projectOptions, forceRebuild, "build")
if err != nil {
return err
}

View File

@@ -66,7 +66,7 @@ func init() {
// Install deps
if projectOptions.FrontEnd != nil {
err = cmd.InstallFrontendDeps(projectDir, projectOptions, forceRebuild)
err = cmd.InstallFrontendDeps(projectDir, projectOptions, forceRebuild, "serve")
if err != nil {
return err
}