Skip to content

Commit

Permalink
Fixed a couple small bugs in the upgrade script.
Browse files Browse the repository at this point in the history
Bumped to v0.0.3.
  • Loading branch information
jhuckaby committed Jan 8, 2016
1 parent e5c97d9 commit a28768c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ do
;;
upgrade)
$0 stop
node $HOMEDIR/bin/install.js $1
node $HOMEDIR/bin/install.js $2
$0 start
;;
*)
Expand Down
33 changes: 23 additions & 10 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,29 @@ cp.exec('curl -s ' + gh_releases_url, function (err, stdout, stderr) {

// finally, run postinstall script
cp.exec('node bin/build.js dist', function (err, stdout, stderr) {
print( stdout.toString() );
warn( stderr.toString() );

if (err) {
die("Failed to run post-install: " + err);
}

// Success!
if (is_preinstalled) print("Upgrade complete.\n\n");
else print("Installation complete.\n\n");
if (is_preinstalled) {
// for upgrades only print output on error
if (err) {
print( stdout.toString() );
warn( stderr.toString() );
die("Failed to run post-install: " + err);
}
else {
print("Upgrade complete.\n\n");
}
} // upgrade
else {
// first time install, always print output
print( stdout.toString() );
warn( stderr.toString() );

if (err) {
die("Failed to run post-install: " + err);
}
else {
print("Installation complete.\n\n");
}
} // first install

logonly( "Completed install run: " + (new Date()).toString() + "\n" );

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Cronicle",
"version": "0.0.2",
"version": "0.0.3",
"description": "A simple, distributed task scheduler and runner with a web based UI.",
"author": "Joseph Huckaby <[email protected]>",
"homepage": "https://github.com/jhuckaby/Cronicle",
Expand Down

0 comments on commit a28768c

Please sign in to comment.