Files
tipsi-stripe/example/scripts/pre-install.js
2018-06-27 20:22:22 +03:00

16 lines
483 B
JavaScript
Executable File

#!/usr/bin/env node
const path = require('path')
const { execSync } = require('child_process')
const { name, version } = require('../../package.json')
const rootDirectory = path.join(__dirname, '../..')
// 1. Remove all *.tgz before install
execSync('rm -rf *.tgz', { cwd: rootDirectory })
// 2. Do npm pack
execSync('npm pack', { cwd: rootDirectory })
// 3. Rename .tgz to tipsi-stripe-latest.tgz
execSync(`mv ${name}-${version}.tgz ${name}-latest.tgz`, { cwd: rootDirectory })