install.fairie/home/dot_local/bin/post-installx/executable_post-fig.sh

16 lines
389 B
Bash
Raw Normal View History

2024-05-03 19:40:44 -07:00
#!/usr/bin/env bash
# @file Fig Login
# @brief Logs into Fig using the FIG_TOKEN
2024-05-27 04:15:03 -07:00
set -euo pipefail
2024-05-03 19:40:44 -07:00
if command -v fig > /dev/null; then
2024-05-27 04:15:03 -07:00
### Ensure FIG_TOKEN
get-secret --exists FIG_TOKEN
### Login to Fig
fig login --token "$(get-secret FIG_TOKEN)" || logg info 'Fig login failed - User might already be logged in'
2024-05-03 19:40:44 -07:00
else
logg warn 'fig is not available in the PATH'
fi