swiftDialog icon indicating copy to clipboard operation
swiftDialog copied to clipboard

refactor the dialog shell script to be pure bourne shell

Open virtualpeter opened this issue 1 year ago • 6 comments

Bourne Shell purity:

  • this script was depending on bashism although being run as sh, this is fine on todays macOS but wouldnt run so well if it was using zsh or dash compailtibilty mode, and Apple might just decide to move away from bash in future releases.

Refine handling of commandfile:

  • the checking of readability of commandfile was not working like the comments suggest was intended and had weaknesses handling filenames with spaces (I know, who would want to do that?).
  • do the sudo to console user in-script so commandfile checking can be done as console user.

virtualpeter avatar Oct 15 '24 10:10 virtualpeter

See https://github.com/swiftDialog/swiftDialog/discussions/391 for a previous discussion/proposal on this

fraserhess avatar Oct 15 '24 12:10 fraserhess

I'm happy to accept a PR on this but just to set expectations, I'm re-factoring a bunch of stuff and this shell script won't be around for very long 🙂

bartreardon avatar Oct 15 '24 22:10 bartreardon

i have also identified some things the swift app does around handling the command file that i would like to improve and was starting to think perhaps no need for a script at all

virtualpeter avatar Oct 16 '24 02:10 virtualpeter

See #391 for a previous discussion/proposal on this

i hope this PR achieves what you were suggesting there.

virtualpeter avatar Oct 16 '24 02:10 virtualpeter

See #391 for a previous discussion/proposal on this

i hope this PR achieves what you were suggesting there.

It has the same spirit but the proposal (making it POSIX) goes in the opposite direction

fraserhess avatar Oct 16 '24 02:10 fraserhess

i have also identified some things the swift app does around handling the command file that i would like to improve and was starting to think perhaps no need for a script at all

There are many things that will be changing. I'm not doing any more work on the 2.x branch other than bug fixes and all effort is directed to v3.

bartreardon avatar Oct 16 '24 04:10 bartreardon

I'm going to close this PR because the dialog shell script has now been converted to swift ready for a future release https://github.com/swiftDialog/swiftDialog/blob/dev_2.6/dialogcli/dialogcli.swift

Thank you for the effort in refactoring the shell script though. I do appreciate the attention on this aspect and desire to contribute improvements 🙂. All future work will be towards migrating argument processing out of the app bundle and over to the cli helper.

bartreardon avatar Jul 22 '25 12:07 bartreardon