Browse Source

Merge pull request #105 from zeit/add/deploy-public-option

[WIP] deploy: add `--public` option
master
Tony Kovanen 9 years ago
committed by GitHub
parent
commit
6cf81fd084
  1. 6
      bin/now-deploy
  2. 4
      lib/index.js

6
bin/now-deploy

@ -25,6 +25,7 @@ const argv = minimist(process.argv.slice(2), {
force: 'f',
forceSync: 'F',
login: 'L',
public: 'p',
'no-clipboard': 'C',
'forward-npm': 'N'
}
@ -50,6 +51,7 @@ const help = () => {
-d, --debug debug mode [off]
-f, --force force a new deployment even if nothing has changed
-L, --login configure login
-p, --public deployment is public (\`/_src\` is exposed) [on for oss, off for premium]
-C, --no-clipboard do not attempt to copy URL to clipboard
-N, --forward-npm Forward login information to install private NPM modules
@ -102,6 +104,7 @@ const forwardNpm = argv['forward-npm'];
const forceNew = argv.force;
const forceSync = argv.forceSync;
const shouldLogin = argv.login;
const wantsPublic = argv.public;
const apiUrl = argv.url || 'https://api.zeit.co';
const isTTY = process.stdout.isTTY;
const quiet = !isTTY;
@ -227,7 +230,8 @@ async function sync (token) {
forceNew,
forceSync,
forwardNpm: alwaysForwardNpm || forwardNpm,
quiet
quiet,
wantsPublic
});
} catch (err) {
if (debug) console.log(`> [debug] error: ${err.stack}`);

4
lib/index.js

@ -35,6 +35,7 @@ export default class Now extends EventEmitter {
}
async create (path, {
wantsPublic,
quiet = false,
forceNew = false,
forceSync = false,
@ -176,10 +177,11 @@ export default class Now extends EventEmitter {
const res = await this._fetch('/now/create', {
method: 'POST',
body: {
public: wantsPublic,
forceNew,
forceSync,
name: name,
description: description,
description,
deploymentType,
registryAuthToken: authToken,
// Flatten the array to contain files to sync where each nested input

Loading…
Cancel
Save