Browse Source

Merge pull request #95 from zeit/add/shorter-deploy-message

Add shorter deploy message
master
Tony Kovanen 9 years ago
committed by GitHub
parent
commit
f7ff9d2d44
  1. 3
      bin/now-deploy
  2. 4
      lib/error.js
  3. 14
      lib/utils/to-human-path.js

3
bin/now-deploy

@ -10,6 +10,7 @@ import bytes from 'bytes';
import chalk from 'chalk';
import minimist from 'minimist';
import Now from '../lib';
import toHumanPath from '../lib/utils/to-human-path';
import ms from 'ms';
import { handleError, error } from '../lib/error';
@ -139,7 +140,7 @@ async function sync (token) {
const start = Date.now();
if (!quiet) {
console.log(`> Deploying "${path}"`);
console.log(`> Deploying ${chalk.bold(toHumanPath(path))}`);
}
const now = new Now(apiUrl, token, { debug });

4
lib/error.js

@ -21,6 +21,6 @@ export function handleError (err) {
}
}
export function error (msg) {
console.error(`> ${chalk.red('Error')} ${msg}`);
export function error (err) {
console.error(`> ${chalk.red('Error!')} ${err}`);
}

14
lib/utils/to-human-path.js

@ -0,0 +1,14 @@
import { resolve } from 'path';
// cleaned-up `$HOME` (i.e.: no trailing slash)
const HOME = resolve(process.env.HOME);
/**
* Attempts to show the given path in
* a human-friendly form. For example,
* `/Users/rauchg/test.js` becomes `~/test.js`
*/
export default function toHumanPath (path) {
return path.replace(HOME, '~');
}
Loading…
Cancel
Save