Comparing version 0.0.3 to 0.0.4
16
app.js
@@ -9,2 +9,6 @@ #!/usr/bin/env node | ||
var chalk = require('chalk'); | ||
var Spinner = require('cli-spinner').Spinner; | ||
Spinner.setDefaultSpinnerString(18); | ||
var spinner = new Spinner('Talking to Serve Swifton.me…'); | ||
var app = require('commander'); | ||
@@ -26,2 +30,3 @@ | ||
} | ||
spinner.start(); | ||
request | ||
@@ -36,2 +41,3 @@ .postAsync({ | ||
.then(function (response) { | ||
spinner.stop(true); | ||
if (response.body.success !== true) { | ||
@@ -49,2 +55,3 @@ return console.log('Something went wrong when deploying your App. Please check your repository Git url and try again.'); | ||
.catch(function (err) { | ||
spinner.stop(true); | ||
console.error(chalk.bold.red('An error occured when trying to deploy your repository:'), err); | ||
@@ -59,2 +66,3 @@ }); | ||
.action(function (containerId) { | ||
spinner.start(); | ||
request | ||
@@ -65,2 +73,3 @@ .delAsync({ | ||
.then(function (response) { | ||
spinner.stop(true); | ||
if (response.statusCode === 200) { | ||
@@ -72,2 +81,3 @@ return console.log(chalk.bold.green('App deleted successfully!')); | ||
.catch(function (err) { | ||
spinner.stop(true); | ||
console.error(chalk.bold.red('An error occured when trying to delete your App:'), err); | ||
@@ -82,2 +92,3 @@ }); | ||
.action(function (containerId) { | ||
spinner.start(); | ||
request | ||
@@ -88,5 +99,7 @@ .getAsync({ | ||
.then(function (response) { | ||
spinner.stop(true); | ||
console.log(response.body); | ||
}) | ||
.catch(function (err) { | ||
spinner.stop(true); | ||
console.error(chalk.bold.red('An error occured when trying to stream your App\'s logs:'), err); | ||
@@ -101,2 +114,3 @@ }); | ||
.action(function (containerId) { | ||
spinner.start() | ||
request | ||
@@ -108,2 +122,3 @@ .getAsync({ | ||
.then(function (response) { | ||
spinner.stop(true); | ||
if (response.statusCode !== 200) { | ||
@@ -124,2 +139,3 @@ console.log([ | ||
.catch(function (err) { | ||
spinner.stop(true); | ||
console.error(chalk.bold.red('An error occured when trying to query your App\'s status:'), err); | ||
@@ -126,0 +142,0 @@ }); |
{ | ||
"name": "swifton", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "The official CLI for Swifton.me", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
5345
127