We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I run mina -S deploy get deploy script, It contains:
mina -S deploy
#!/usr/bin/env bash # Bail out ASAP set -e .... # Determine $previous_path and other variables [ -h "current" ] && [ -d "current" ] && previous_path=$(cd "current" >/dev/null && pwd -LP) build_path="./tmp/build-`date +%s`$RANDOM" version=$((`cat "/var/www/project/last_version" 2>/dev/null`+1)) release_path="releases/$version" ...
When getting last version with cat, it failed and exit because of last_version file is missing.
last_version
mina setup should create last_version file with 0, or deploy script check file exist or not.
mina setup
At last, I create this file myself to work around this issue.
The text was updated successfully, but these errors were encountered:
That's strange, as 2>/dev/null does exactly what you need - checks if last_version exists.
2>/dev/null
$ cat last_version cat: last_version: No such file or directory
$ cat last_version 2>/dev/null
$ version=$((`cat "last_version" 2>/dev/null`+1)) $ echo $version 1
Could you attach the full error log? (mina deploy -v)
Sorry, something went wrong.
@flowerett
Hi, because the generated bash script has set -e declaration. The script exits immediately if a command exits with a non-zero status.
set -e
version=$((`cat "last_version" 2>/dev/null`+1))
This can get version 1, but the whole script exits here.
You can test it with this demo script:
#!/bin/bash set -e cat does_not_exist_file 2>/dev/null echo "ok"
Here is full log of mina deploy -v.
mina deploy -v
$ mina deploy -v ! Command failed. Failed with status 1 (1)
Hm... thx for cacthcing this. Obviously we will have to remove that set -e :(
7ab6a58
No branches or pull requests
I run
mina -S deploy
get deploy script, It contains:When getting last version with cat, it failed and exit because of
last_version
file is missing.mina setup
should createlast_version
file with 0, or deploy script check file exist or not.At last, I create this file myself to work around this issue.
The text was updated successfully, but these errors were encountered: