Browse Source

Auto generate a `pkg.json` based on `package.json` (#341)

master
Matheus Fernandes 8 years ago
committed by Leo Lamprecht
parent
commit
712af5ddb2
  1. 2
      bin/now-deploy.js
  2. 2
      bin/now.js
  3. 4
      build.sh
  4. 2
      lib/login.js
  5. 2
      lib/ua.js

2
bin/now-deploy.js

@ -17,7 +17,7 @@ const dotenv = require('dotenv')
const copy = require('../lib/copy')
const login = require('../lib/login')
const cfg = require('../lib/cfg')
const {version} = require('../lib/pkg')
const {version} = require('../pkg')
const Logger = require('../lib/build-logger')
const Now = require('../lib')
const toHumanPath = require('../lib/utils/to-human-path')

2
bin/now.js

@ -10,7 +10,7 @@ const chalk = require('chalk')
// Ours
const {error} = require('../lib/error')
const pkg = require('../lib/pkg')
const pkg = require('../pkg')
// Throw an error if node version is too low
if (nodeVersion.major < 6) {

4
build.sh

@ -8,3 +8,7 @@ find lib/** -type f -exec node_modules/.bin/async-to-gen --out-file build/{} {}
find bin/** -type f -exec node_modules/.bin/async-to-gen --out-file build/{} {} \;
chmod +x build/bin/now.js
cp lib/utils/billing/*.json build/lib/utils/billing/
# extracts `name` and `version` from ./package.json
# and ouputs it to build/pkg.json
echo "{`grep -e '\"version\|name\"' ./package.json | sed -e 's/ //g' | tr -d '\n' | sed -e 's/.$//g'`}" > build/pkg.json

2
lib/login.js

@ -10,7 +10,7 @@ const readEmail = require('email-prompt')
const ora = require('ora')
// Ours
const pkg = require('../lib/pkg')
const pkg = require('../pkg')
const ua = require('./ua')
const cfg = require('./cfg')

2
lib/ua.js

@ -2,6 +2,6 @@
const os = require('os')
// Ours
const {version} = require('../lib/pkg')
const {version} = require('../pkg')
module.exports = `now ${version} node-${process.version} ${os.platform()} (${os.arch()})`

Loading…
Cancel
Save