diff --git a/bin/now-deploy b/bin/now-deploy index 019a22a..86aa9f4 100755 --- a/bin/now-deploy +++ b/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'; @@ -138,7 +139,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 }); diff --git a/lib/utils/to-human-path.js b/lib/utils/to-human-path.js new file mode 100644 index 0000000..a8533c9 --- /dev/null +++ b/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, '~'); +}