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

implement a shell context manipulation macro #111

Open
retrogradeorbit opened this issue Jul 8, 2020 · 2 comments
Open

implement a shell context manipulation macro #111

retrogradeorbit opened this issue Jul 8, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@retrogradeorbit
Copy link
Member

retrogradeorbit commented Jul 8, 2020

Often the context of running shells needs to be mainuplated for a bunch of shell commands. I propose a shell context macro. Something like

(with-shell-context {:cmd-prefix ". .nvm/nvm.sh"}
    (shell {:cmd "nvm install 12.18.2"})
    (shell {:cmd "nvm alias default node"}))

or

(with-shell-context {:env {:NVM_BIN "/home/crispin/.nvm/versions/node/v12.18.2/bin"
                           :NVM_CD_FLAGS ""
                           :NVM_DIR "/home/crispin/.nvm"
                           :NVM_INC "/home/crispin/.nvm/versions/node/v12.18.2/include/node"}}
    (shell {:cmd "nvm alias default node"})
    (shell {:cmd "npx electron-packager . tilemapgl --platform=win32 --arch=x64"}))
@retrogradeorbit retrogradeorbit added the enhancement New feature or request label Jul 8, 2020
@tomconnors
Copy link
Contributor

Would this macro reuse the shell across calls to the module so that nvm.sh is only sourced one time, or would the macro just handle adding the ". .nvm/nvm" prefix to each shell call? If it's the latter, I don't think spire needs to provide this.

@retrogradeorbit
Copy link
Member Author

It would prefix the call to each invocation. It still could be a convenience function. It might also be useful for a common environment variable setting like PATH.

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

No branches or pull requests

2 participants