hotfix(pkg): fix edge versioning

This commit is contained in:
Pooya Parsa 2018-11-28 22:14:11 +03:30
parent 056704f17c
commit 2f1e0045cc
2 changed files with 9 additions and 9 deletions

View File

@ -27,8 +27,8 @@ async function main() {
// Step 1: Apply suffixes // Step 1: Apply suffixes
for (const pkg of workspacePackages) { for (const pkg of workspacePackages) {
if (pkg.options.suffix && pkg.options.suffix.length) { if (pkg.options.suffix && pkg.options.suffix.length) {
pkg.suffixAndVersion() await pkg.suffixAndVersion()
pkg.writePackage() await pkg.writePackage()
} }
} }

View File

@ -1,6 +1,6 @@
import { resolve } from 'path' import { resolve } from 'path'
import consola from 'consola' import consola from 'consola'
import { spawn } from 'cross-spawn' import spawn from 'cross-spawn'
import { existsSync, readJSONSync, writeFile, copy, remove } from 'fs-extra' import { existsSync, readJSONSync, writeFile, copy, remove } from 'fs-extra'
import _ from 'lodash' import _ from 'lodash'
import { rollup, watch } from 'rollup' import { rollup, watch } from 'rollup'
@ -307,8 +307,8 @@ export default class Package {
} }
} }
async exec(command, args, silent = false) { exec(command, args, silent = false) {
const r = await spawn(command, args.split(' '), { cwd: this.options.rootDir }, { env: process.env }) const r = spawn.sync(command, args.split(' '), { cwd: this.options.rootDir }, { env: process.env })
if (!silent) { if (!silent) {
const fullCommand = command + ' ' + args const fullCommand = command + ' ' + args
@ -333,13 +333,13 @@ export default class Package {
} }
} }
async gitShortCommit() { gitShortCommit() {
const { stdout } = await this.exec('git', 'rev-parse --short HEAD', true) const { stdout } = this.exec('git', 'rev-parse --short HEAD', true)
return stdout return stdout
} }
async gitBranch() { gitBranch() {
const { stdout } = await this.exec('git', 'rev-parse --abbrev-ref HEAD', true) const { stdout } = this.exec('git', 'rev-parse --abbrev-ref HEAD', true)
return stdout return stdout
} }
} }