Skip to content

Commit

Permalink
Fix publish.py issue if not specified --dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Oct 26, 2019
1 parent 1ba4089 commit aad781e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def main():
if not os.path.exists(workdir):
os.makedirs(workdir)
distdir = os.path.join(ROOT_DIR, 'dist')
dryrun = '--dry-run' if args.dry_run else ''

print('\n\n========== Publish standard package ==========')
with PackageConfigPatcher(''):
Expand All @@ -67,7 +66,10 @@ def main():
subprocess.check_call(
['tar', '-xf', args.dist_tar_file, '-C', workdir])
shutil.move(os.path.join(workdir, 'dist'), distdir)
subprocess.check_call(['npm', 'publish', dryrun, '--tag', args.tag])
cmds = ['npm', 'publish', '--tag', args.tag]
if args.dry_run:
cmds.append('--dry-run')
subprocess.check_call(cmds)

print('\n\n========== Publish unstripped package ==========')
with PackageConfigPatcher('unstripped'):
Expand All @@ -76,8 +78,10 @@ def main():
subprocess.check_call(
['tar', '-xf', args.dist_tar_file, '-C', workdir])
shutil.move(os.path.join(workdir, 'dist.unstripped'), distdir)
subprocess.check_call(
['npm', 'publish', dryrun, '--tag', args.tag + '-unstripped'])
cmds = ['npm', 'publish', '--tag', args.tag + '-unstripped']
if args.dry_run:
cmds.append('--dry-run')
subprocess.check_call(cmds)

shutil.rmtree(workdir)

Expand Down

0 comments on commit aad781e

Please sign in to comment.