Skip to content

Instantly share code, notes, and snippets.

@shyim
Created November 12, 2023 14:35
Show Gist options
  • Save shyim/4915eaf7d35b460aa55d04549d26d022 to your computer and use it in GitHub Desktop.
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
#!/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