-
Notifications
You must be signed in to change notification settings - Fork 342
Conversation
paths.go
Outdated
@@ -64,7 +64,7 @@ func newPaths(os, arch string, o Options) (p *Paths, err error) { | |||
p.electronDownloadSrc = ElectronDownloadSrc(os, arch, o.VersionElectron) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather
- you put lines 63 --> 67 in a
if o.CustomElectronPath == ""
- and in this function, the
else
is directlyp.appExecutable = o.CustomElectronPath,
Otherwise this won't work
paths.go
Outdated
@@ -64,7 +64,7 @@ func newPaths(os, arch string, o Options) (p *Paths, err error) { | |||
p.electronDownloadSrc = ElectronDownloadSrc(os, arch, o.VersionElectron) | |||
p.electronDownloadDst = filepath.Join(p.vendorDirectory, fmt.Sprintf("electron-%s-%s-v%s.zip", os, arch, o.VersionElectron)) | |||
p.electronUnzipSrc = p.electronDownloadDst | |||
p.initAppExecutable(os, o.AppName) | |||
p.initAppExecutable(os, o.CustomElectronPath, o.AppName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to inject o.CustomElectronPath
anymore
paths.go
Outdated
case "windows": | ||
p.appExecutable = filepath.Join(p.electronDirectory, "electron.exe") | ||
} else { | ||
p.appExecutable = customElectronPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI there are no ;
in GO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol habits die hard ;)
provisioner.go
Outdated
@@ -151,6 +151,8 @@ func (p *defaultProvisioner) provisionAstilectron(ctx context.Context, paths Pat | |||
|
|||
// provisionElectron provisions electron | |||
func (p *defaultProvisioner) provisionElectron(ctx context.Context, paths Paths, s ProvisionStatus, appName, os, arch, versionElectron string) error { | |||
if paths.ElectronUnzipSrc() == "" { return nil } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With GO formatting, this needs new lines:
if paths.ElectronUnzipSrc() == "" {
return nil
}
provisioner.go
Outdated
@@ -151,6 +151,8 @@ func (p *defaultProvisioner) provisionAstilectron(ctx context.Context, paths Pat | |||
|
|||
// provisionElectron provisions electron | |||
func (p *defaultProvisioner) provisionElectron(ctx context.Context, paths Paths, s ProvisionStatus, appName, os, arch, versionElectron string) error { | |||
if paths.ElectronUnzipSrc() == "" { return nil } | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for that new line
0b34d5c
to
5484f63
Compare
paths.go
Outdated
@@ -144,7 +148,6 @@ func ElectronDownloadSrc(os, arch, versionElectron string) string { | |||
return fmt.Sprintf("https://github.com/electron/electron/releases/download/v%s/electron-v%s-%s-%s.zip", versionElectron, versionElectron, o, a) | |||
} | |||
|
|||
// initAppExecutable initializes the app executable path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep this comment?
Oops that's an unintentional leftover from the now-rolled-back change. Will add it back - though perhaps it's an indication it should be renamed 'appExecutablePath'?
…On 20 February 2021 09:44:46 CET, Quentin Renard ***@***.***> wrote:
@asticode requested changes on this pull request.
> @@ -144,7 +148,6 @@ func ElectronDownloadSrc(os, arch, versionElectron string) string {
return fmt.Sprintf("https://github.com/electron/electron/releases/download/v%s/electron-v%s-%s-%s.zip", versionElectron, versionElectron, o, a)
}
-// initAppExecutable initializes the app executable path
Can you keep this comment?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#311 (review)
|
no worries. I think Once you've made the change, can you test running the example in your NixOS and let me know whether this works properly? |
Yes, that works!
…On 20 February 2021 11:05:43 CET, Quentin Renard ***@***.***> wrote:
no worries. I think `initAppExecutable` is fine for now.
Once you've made the change, can you test running the example in your NixOS and let me know whether this works properly?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#311 (comment)
|
5484f63
to
560b52e
Compare
example/main.go
Outdated
@@ -14,8 +14,9 @@ func main() { | |||
|
|||
// Create astilectron | |||
a, err := astilectron.New(l, astilectron.Options{ | |||
AppName: "Test", | |||
BaseDirectoryPath: "example", | |||
//CustomElectronPath: "/nix/store/srxbsf62sapfi2vginqshhicbqgzsnsx-electron-11.2.3/bin/electron", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this comment?
OK great, just remove the last comment and I'll merge the PR |
560b52e
to
38e9da9
Compare
This is useful on systems (like NixOS) where the Electron downloaded by go-astilectron does not work out of the box, but it is possible to install a working Electron separately.
38e9da9
to
0b464bc
Compare
Cheers |
thanks for the detailed directions/feedback! |
This is useful on systems (like NixOS) where the Electron downloaded
by go-astilectron does not work out of the box, but it is possible to
install a working Electron separately.
Refs #309