go-script-bash icon indicating copy to clipboard operation
go-script-bash copied to clipboard

Supports multiple command script sources

Open nkakouros opened this issue 5 years ago • 3 comments

cc: @mbland

I added support for multiple command script sources by making _GO_SCRIPTS_DIR an array. This allows for flexible project structures.

My use case

I am using go-script-bash in many project of mine. I have build some scripts and a folder structure that I use in all my projects. But, while working on a project, I add features, fix bugs, etc on this common 'skeleton'. Then, I have to copy stuff around to bring all my projects on par. I would like to have this skeleton as a separate project that I can add as a git submodule. For this to happen, it is needed that go-script-bash supports multiple command script sources. In this case, I would be able to load both the commands from the "skeleton" project and each separate project that is build on top of the "skeleton".

nkakouros avatar Jan 28 '19 21:01 nkakouros

@mbland I realize you are currently lacking time to go through the issues/PRs, it would be nice to have some feedback, though, whenever you find the time.

nkakouros avatar Jan 28 '19 21:01 nkakouros

Coverage Status

Coverage increased (+0.09%) to 95.087% when pulling 9814499efe41e4683afd47756e0e56c98e68e0b1 on nkakouros-forks:multiple-script-dirs into 292e0803074eb538ab8633a657c53d3a975ba922 on mbland:master.

coveralls avatar Jan 28 '19 21:01 coveralls

The error on windows is a strange one. On linux instances, the result of the failing test is scripts-2 scripts. I have tried with bash 3.2, 4.3, 4.4 and 5.0 on Arch and Ubuntu 18.04. On Windows, however it is the other way around. Judging by the tests on macos, this holds true there too. I also tried with Centos7 and it follows Windows' behavior.

I tried to find the cause of this and my finding was that compgen behaves differently. On linux, running compgen -f -- on the prompt of bash --norc --noprofile, does not order the returned values alphabetically. On windows, it does. Adding -o nosort does not change the result.

I don't know how to debug this further.

As for the failing macos test, I don't have access to a macos installation to try to debug it.

nkakouros avatar Jan 30 '19 20:01 nkakouros