-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update PR message with publish command (#467)
* fix: update PR message with publish command * fix: update test snapshot
- Loading branch information
Eunjae Lee
authored
Nov 30, 2019
1 parent
f079ba5
commit 18cc7e4
Showing
7 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default function getPublishCommand({ | ||
isYarn, | ||
publishCommand, | ||
tag, | ||
dir, | ||
}) { | ||
const defaultCommand = isYarn | ||
? `yarn publish --no-git-tag-version --non-interactive --tag ${tag}` | ||
: `npm publish --tag ${tag}`; | ||
|
||
return publishCommand({ isYarn, tag, defaultCommand, dir }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
import { expandPackageList } from 'shipjs-lib'; | ||
import runStep from '../runStep'; | ||
import { run, print } from '../../util'; | ||
import { getPublishCommand } from '../../helper'; | ||
import { info } from '../../color'; | ||
|
||
export default ({ isYarn, config, releaseTag: tag, dir, dryRun }) => | ||
runStep({ title: 'Publishing.' }, () => { | ||
const { publishCommand, monorepo } = config; | ||
const defaultCommand = isYarn | ||
? `yarn publish --no-git-tag-version --non-interactive --tag ${tag}` | ||
: `npm publish --tag ${tag}`; | ||
|
||
if (monorepo) { | ||
const { packagesToPublish } = monorepo; | ||
const packageList = expandPackageList(packagesToPublish, dir); | ||
packageList.forEach(packageDir => { | ||
const command = publishCommand({ | ||
const command = getPublishCommand({ | ||
isYarn, | ||
publishCommand, | ||
tag, | ||
defaultCommand, | ||
dir: packageDir, | ||
}); | ||
print(`Running the following at ${info(packageDir)}`); | ||
run({ command, dir: packageDir, dryRun }); | ||
}); | ||
} else { | ||
const command = publishCommand({ isYarn, tag, defaultCommand, dir }); | ||
const command = getPublishCommand({ isYarn, publishCommand, tag, dir }); | ||
run({ command, dir, dryRun }); | ||
} | ||
}); |