Skip to content

Commit

Permalink
feat: test for opentofu
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollorion committed Jun 6, 2024
1 parent 98f4a28 commit 0b4b704
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spacemk/commands/import_state_files_to_spacelift.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ def _create_context(spacelift: Spacelift, space_id: str, token: str):
--silent \
"${STATE_DOWNLOAD_URL}"
set +e
binary="terraform"
if ! command $binary; then
echo "Terraform is not installed"
if ! command -v $binary &> /dev/null; then
echo "Terraform not found, using OpenTofu"
binary="tofu"
if ! command $binary; then
echo "OpenTofu is not installed"
if ! command -v $binary &> /dev/null; then
echo "OpenTofu not found, Failing run..."
exit 1
fi
fi
set -euo pipefail
echo "Using Binary: $binary"
$binary state push -force state.tfstate
"""

Expand Down

0 comments on commit 0b4b704

Please sign in to comment.