Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Fix for issue #179 #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion astilectron.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ func New(o Options) (a *Astilectron, err error) {
return
}

if o.AppName == "" {
o.AppName = "astilectron"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use Astilectron instead of astilectron?

}

// Init
a = &Astilectron{
canceller: asticontext.NewCanceller(),
Expand Down Expand Up @@ -125,6 +129,7 @@ func New(o Options) (a *Astilectron, err error) {
a.displayPool.update(e.Displays)
return
})

return
}

Expand Down Expand Up @@ -269,7 +274,7 @@ func (a *Astilectron) execute() (err error) {
} else {
singleInstance = "false"
}
var cmd = exec.CommandContext(ctx, a.paths.AppExecutable(), append([]string{a.paths.AstilectronApplication(), a.listener.Addr().String(), singleInstance}, a.options.ElectronSwitches...)...)
var cmd = exec.CommandContext(ctx, a.paths.AppExecutable(), append([]string{a.paths.AstilectronApplication(), a.listener.Addr().String(), singleInstance, a.options.AppName}, a.options.ElectronSwitches...)...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have the full path provided here through the Paths structure:

  1. create a new attribute named electronUserData in the Paths structure
  2. compute its value in newPaths using the same logic you used in the JS PR. You should use other Paths attributes such as electronDirectory that could be useful in your case to build the value.
  3. provide it to Electron the same way you provided a.options.AppName

a.stderrWriter = astiexec.NewStdWriter(func(i []byte) { astilog.Debugf("Stderr says: %s", i) })
a.stdoutWriter = astiexec.NewStdWriter(func(i []byte) { astilog.Debugf("Stdout says: %s", i) })
cmd.Stderr = a.stderrWriter
Expand Down