Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports multiple command script sources #249

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

nkakouros
Copy link

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 nkakouros changed the title Multiple script dirs Supports multiple command script sources Jan 28, 2019
@nkakouros
Copy link
Author

@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 nkakouros closed this Jan 28, 2019
@nkakouros nkakouros reopened this Jan 28, 2019
@coveralls
Copy link

coveralls commented Jan 28, 2019

Coverage Status

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

@nkakouros
Copy link
Author

nkakouros commented Jan 30, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants