project-flogo / cli

CLI used to create & build Flogo applications.
BSD 3-Clause "New" or "Revised" License
32 stars 36 forks source link

fix(plugin install): copy executable by renaming instead of create file #123

Open c84c opened 2 years ago

c84c commented 2 years ago

Implements

Fix #121

Discussion

During refactoring on commit change plugin build mechanism the new flogo executable is created instead of renamed.

Linux system not allows to update a running executable resulting in error text file busy.

The PR insert a SwapFile function to allow replacement of running executable (Thanks to @fenollp and his gist)

Code references

Old renaming implementation on commits before change plugin build mechanism : https://github.com/project-flogo/cli/blob/22cf3e37128c33d6c0bbb5cd90af3cb978a1083b/commands/plugin.go#L267

Actual implementation on master: Executable copy: https://github.com/project-flogo/cli/blob/5c3e1e36e17aa2ead2d5774d0ce89b2641107c8f/commands/pluginhelper.go#L108 copyFile function https://github.com/project-flogo/cli/blob/5c3e1e36e17aa2ead2d5774d0ce89b2641107c8f/util/file.go#L131-L143

c84c commented 2 years ago

Have you planned when to merge the Pull Request?