Open fmancardi opened 1 year ago
Great idea!
Hey @maidul98, I looked into this. A quick fix would be to check if the command exists in %PATH% (alias check), get the 'SHELL' environment variable and run the command as a sub command. ( In https://github.com/Infisical/infisical/blob/a3093de55b28b3e5a0bd56b794a59b7f2794c342/cli/packages/cmd/run.go#L188)
Eg: '[SHELL] -c [aliasCmd]' for git bash: '[/path/to/bash] -c [aliasCmd]'
However aliases aren't passed to sub processes. As a work around, in substitute for aliases, you could create a function in your .bashrc / bash_profile.sh which returns the cmd you're aliasing and export it.
Is help still needed on this issue? I would love to work on it!
@quinton11 that makes sense and to source the file you can also just point to a script file. This way we can do something like this which already works out of the box
infisical run --command="source ./myfunctions.sh && ll"
where myfunctions.sh is
#!/bin/sh
ll() {
ls -l "$@"
}
I think adding this to the documentation should help others become aware of this. What do you think @parthvnp @quinton11
Yep, sounds great... would you handle updating the documentation? I can pick it up if not. Or perhaps @parthvnp ?
I can handle the updating documentation !
Cool, we use https://mintlify.com/ so feed free to cd into the docs folder and start up mintlify with mintlify dev
command after you install it
Feature description
I would like to be able to using: infisical run to run an alias
infisical run -- rcxx-preprod blind
rccno-prepod is the following alias:
alias rcxx-preprod='./runners/runit.chrome.cxx-preprod.sh'
When running rcnno-preprod, it will be expanded to:
testcafe 'chrome --start-fullscreen' --cfg=cxx-preprod.json ./test/blind-man-navigation.js
Why would it be useful?
To have shortcut to long commands
Right now what you get is this error:
Environment
gitbash on windows 11