diff --git a/update-cursor.sh b/update-cursor.sh index 2cf913f..080460b 100755 --- a/update-cursor.sh +++ b/update-cursor.sh @@ -103,12 +103,16 @@ main() { # Check if update is needed if [[ "$target_version" == "$current_version" ]]; then echo "No update needed. Current version is up to date." - echo "CURSOR_VERSION_INFO=no_update" >> "$GITHUB_OUTPUT" 2>/dev/null || true + if [[ -n "${GITHUB_OUTPUT:-}" ]]; then + echo "CURSOR_VERSION_INFO=no_update" >> "$GITHUB_OUTPUT" + fi exit 0 fi echo "Update needed: $current_version -> $target_version" - echo "CURSOR_VERSION_INFO=updated:$current_version:$target_version" >> "$GITHUB_OUTPUT" 2>/dev/null || true + if [[ -n "${GITHUB_OUTPUT:-}" ]]; then + echo "CURSOR_VERSION_INFO=updated:$current_version:$target_version" >> "$GITHUB_OUTPUT" + fi # Check if running in CI/GitHub Actions (auto-confirm) if [[ -n "${CI:-}" ]] || [[ -n "${GITHUB_ACTIONS:-}" ]]; then @@ -123,7 +127,9 @@ main() { update_flake "$target_version" test_flake echo "Update completed successfully!" - echo "CURSOR_VERSION_INFO=completed:$current_version:$target_version" >> "$GITHUB_OUTPUT" 2>/dev/null || true + if [[ -n "${GITHUB_OUTPUT:-}" ]]; then + echo "CURSOR_VERSION_INFO=completed:$current_version:$target_version" >> "$GITHUB_OUTPUT" + fi echo "You can now commit the changes:" echo " git add flake.nix" echo " git commit -m \"Update Cursor to version $target_version\""