Alias #
💡Feature in Development Due to the beta status of SetOps, the
--project
and--stage
flag needs to be set for every command.In the future, you will be able to set a default
project
andstage
for a directory.
Set alias with default for directory #
You can use direnv as a shell extension to load and unload environment variables depending on the current directory. With this tool, you can set your project
and stage
for a directory.
-
Install direnv
-
Create a
.envrc
file in your project directory -
Add following
export SETOPS_PROJECT=<PROJECT> export SETOPS_STAGE=<STAGE>
-
Create an alias for your shell, e.g.:
alias sos='setops -p $SETOPS_PROJECT -s $SETOPS_STAGE'
Example #
Your .envrc
should look like this:
# /myproject/.envrc
export SETOPS_PROJECT=myproject
export SETOPS_STAGE=staging
Then you can execute the following commands:
sos app # executes 'setops --project <PROJECT> --stage <STAGE> app'