Created
November 12, 2023 14:35
-
-
Save shyim/4915eaf7d35b460aa55d04549d26d022 to your computer and use it in GitHub Desktop.
1Password WSL Wrapper, populate environment variables in Shell and run Linux programs like with op run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
envFile=$1 | |
# drop first argument | |
shift | |
IFS=$'\n' | |
for line in $(op inject -i $envFile) | |
do | |
eval "export ${line}" | |
done | |
exec $@ | |
# example ./op-run-wsl .server.env docker compose up -d | |
# the docker compose gets call environment variables specified in .server.env but parsed with your Tresor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment