]>
Commit | Line | Data |
---|---|---|
2caad890 | 1 | #!/usr/bin/env bash |
5f5efa6f | 2 | |
da28a4e2 IB |
3 | if [ -z "$NIXOPS_ENV_LOADED" ]; then |
4 | echo "Please load the environment with direnv" | |
4506dbe5 IB |
5 | exit 1; |
6 | fi | |
7 | ||
9690acd9 | 8 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
5f5efa6f IB |
9 | chmod go-rwx $TEMP |
10 | ||
11 | finish() { | |
9690acd9 | 12 | rm -rf "$TEMP" |
da28a4e2 | 13 | nixops set-args --unset privateFiles |
5f5efa6f IB |
14 | } |
15 | ||
16 | trap finish EXIT | |
17 | ||
9690acd9 | 18 | # pass cannot "just" list files in a directory without showing a tree :( |
1052bfda | 19 | files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //') |
9690acd9 IB |
20 | |
21 | for file in $files; do | |
1052bfda | 22 | pass show "Nixops/files/$file" > $TEMP/$file |
9690acd9 | 23 | done |
da28a4e2 | 24 | nixops set-args --argstr privateFiles "$TEMP" |
5f5efa6f | 25 | |
4506dbe5 | 26 | "$@" |