lerna-publisher
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -19,4 +19,11 @@ #!/usr/bin/env node | ||
const { args } = commander_1.default; | ||
async function getWorkingFolder(cmdargs) { | ||
let pathToProject = process.cwd(); | ||
if (arguments.length !== 0 && cmdargs[0] !== '') { | ||
pathToProject = path_1.default.resolve(cmdargs[0]); | ||
} | ||
return pathToProject; | ||
} | ||
async function runTheCommand() { | ||
const pathToProject = path_1.default.resolve(args[0]); | ||
const pathToProject = await getWorkingFolder(args); | ||
console.log('lerna-publisher starting in ' + pathToProject); | ||
@@ -23,0 +30,0 @@ const result = await publish_lerna_1.CheckAndPublishMonorepo(pathToProject).catch(printErrorAndExit); |
{ | ||
"name": "lerna-publisher", | ||
"description": "Utility to publish lerna/yarn/workspace types of packages from ci to npm", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"main": "cjs/index.js", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -0,4 +1,6 @@ | ||
[![Build Status](https://travis-ci.com/wixplosives/lerna-publisher.svg?branch=master)](https://travis-ci.com/wixplosives/lerna-publisher) | ||
# Lerna Publisher | ||
Custom publishing cli for lerna/yarn/workspces project. | ||
Custom publishing cli for lerna/yarn/workspaces projects. | ||
@@ -9,15 +11,10 @@ lerna-publisher will check versions of all subpackages in monorepo and publish them to npmjs if version specified in package.json of subpackage is higher than version in npmjs. | ||
## Installation | ||
``` | ||
npm install lerna-publisher -g | ||
``` | ||
## Usage | ||
## Usage | ||
1. Commit your changes to git | ||
1. run ```lerna publish --skip-npm``` | ||
1. run ```lerna-publisher "path/to/your/repo"``` - this step is usually done in CI that runs | ||
1. run ```lerna version``` | ||
## Example of Travis configuration | ||
Add NPM_TOKEN environment varialbe in Travis Build Settings | ||
Add NPM_TOKEN environment variable in Travis Build Settings | ||
@@ -33,3 +30,3 @@ Add following to the end of your .travis.yml | ||
provider: script | ||
script: lerna-publisher . | ||
script: lerna-publisher | ||
on: | ||
@@ -36,0 +33,0 @@ os: linux |
@@ -22,5 +22,15 @@ #!/usr/bin/env node | ||
async function runTheCommand(){ | ||
const pathToProject = path.resolve(args[0]) | ||
async function getWorkingFolder( cmdargs: string[]) { | ||
let pathToProject = process.cwd() | ||
if (arguments.length !== 0 && cmdargs[0] !== '') { | ||
pathToProject = path.resolve(cmdargs[0]) | ||
} | ||
return pathToProject | ||
} | ||
async function runTheCommand() { | ||
const pathToProject = await getWorkingFolder(args) | ||
console.log('lerna-publisher starting in ' + pathToProject) | ||
const result = await CheckAndPublishMonorepo(pathToProject).catch(printErrorAndExit) | ||
@@ -27,0 +37,0 @@ if ( result) { |
Sorry, the diff of this file is not supported yet
14409
206
47