@leverege/build-tools 2.32.2 → 2.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -187,7 +187,9 @@ const getPackagePath = async ({
187
187
  }
188
188
  return repositoryRoot;
189
189
  };
190
- const checkoutToBranch = async branch => {
190
+ const checkoutToBranch = async ({
191
+ branch
192
+ }) => {
191
193
  try {
192
194
  await (0, _zx.$)`git checkout ${branch}`;
193
195
  } catch (err) {
@@ -271,7 +273,6 @@ const getVersion = async ({
271
273
  branch,
272
274
  packagePath
273
275
  }) => {
274
- await checkoutToBranch(branch);
275
276
  const currentVersion = await getPackageJsonVersion(packagePath);
276
277
  return promptForVersion(currentVersion);
277
278
  };
@@ -377,14 +378,14 @@ const updateNpmPackageJsonAndLock = async config => {
377
378
  const isWorkspace = await isWorkspacePackage();
378
379
  try {
379
380
  if (!isPackageInRepositoryRoot) {
380
- await (0, _zx.$)`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.nothrow();
381
+ await (0, _zx.$)`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.quiet().nothrow();
381
382
  if (isWorkspace) {
382
383
  await (0, _zx.$)`npm install`;
383
384
  } else {
384
385
  await (0, _zx.$)`npm install --prefix ${packagePath}`;
385
386
  }
386
387
  } else {
387
- await (0, _zx.$)`npm version --no-git-tag-version ${version}`.nothrow();
388
+ await (0, _zx.$)`npm version --no-git-tag-version ${version}`.quiet().nothrow();
388
389
  }
389
390
  } catch (err) {
390
391
  console.log(err.stderr || err);
@@ -396,7 +397,7 @@ const createNewBuildCommit = async ({
396
397
  }) => {
397
398
  try {
398
399
  await (0, _zx.$)`git add .`;
399
- await (0, _zx.$)`git commit -m ${buildMessage}`;
400
+ await (0, _zx.$)`git commit --allow-empty -m ${buildMessage}`;
400
401
  } catch (err) {
401
402
  console.log(err.stderr || err);
402
403
  process.exit(1);
@@ -592,6 +593,7 @@ config.repositoryRoot = await getGitRootDirectory();
592
593
  config.branch = args.branch || (await getBranch({
593
594
  branchFilter: args['branch-filter']
594
595
  }));
596
+ await checkoutToBranch(config);
595
597
  const argsPackagePath = args['package-path'] && _path.default.join(config.repositoryRoot, args['package-path']);
596
598
  config.packagePath = argsPackagePath || (await getPackagePath(config));
597
599
  config.isPackageInRepositoryRoot = await isPackageInRepositoryRoot(config);
@@ -187,7 +187,9 @@ const getPackagePath = async ({
187
187
  }
188
188
  return repositoryRoot;
189
189
  };
190
- const checkoutToBranch = async branch => {
190
+ const checkoutToBranch = async ({
191
+ branch
192
+ }) => {
191
193
  try {
192
194
  await (0, _zx.$)`git checkout ${branch}`;
193
195
  } catch (err) {
@@ -271,7 +273,6 @@ const getVersion = async ({
271
273
  branch,
272
274
  packagePath
273
275
  }) => {
274
- await checkoutToBranch(branch);
275
276
  const currentVersion = await getPackageJsonVersion(packagePath);
276
277
  return promptForVersion(currentVersion);
277
278
  };
@@ -377,14 +378,14 @@ const updateNpmPackageJsonAndLock = async config => {
377
378
  const isWorkspace = await isWorkspacePackage();
378
379
  try {
379
380
  if (!isPackageInRepositoryRoot) {
380
- await (0, _zx.$)`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.nothrow();
381
+ await (0, _zx.$)`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.quiet().nothrow();
381
382
  if (isWorkspace) {
382
383
  await (0, _zx.$)`npm install`;
383
384
  } else {
384
385
  await (0, _zx.$)`npm install --prefix ${packagePath}`;
385
386
  }
386
387
  } else {
387
- await (0, _zx.$)`npm version --no-git-tag-version ${version}`.nothrow();
388
+ await (0, _zx.$)`npm version --no-git-tag-version ${version}`.quiet().nothrow();
388
389
  }
389
390
  } catch (err) {
390
391
  console.log(err.stderr || err);
@@ -396,7 +397,7 @@ const createNewBuildCommit = async ({
396
397
  }) => {
397
398
  try {
398
399
  await (0, _zx.$)`git add .`;
399
- await (0, _zx.$)`git commit -m ${buildMessage}`;
400
+ await (0, _zx.$)`git commit --allow-empty -m ${buildMessage}`;
400
401
  } catch (err) {
401
402
  console.log(err.stderr || err);
402
403
  process.exit(1);
@@ -592,6 +593,7 @@ config.repositoryRoot = await getGitRootDirectory();
592
593
  config.branch = args.branch || (await getBranch({
593
594
  branchFilter: args['branch-filter']
594
595
  }));
596
+ await checkoutToBranch(config);
595
597
  const argsPackagePath = args['package-path'] && _path.default.join(config.repositoryRoot, args['package-path']);
596
598
  config.packagePath = argsPackagePath || (await getPackagePath(config));
597
599
  config.isPackageInRepositoryRoot = await isPackageInRepositoryRoot(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.32.2",
3
+ "version": "2.32.4",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -192,7 +192,7 @@ const getPackagePath = async ( { repositoryRoot, packagesPath = DEFAULT_PACKAGES
192
192
  return repositoryRoot
193
193
  }
194
194
 
195
- const checkoutToBranch = async ( branch ) => {
195
+ const checkoutToBranch = async ( { branch } ) => {
196
196
  try {
197
197
  await $`git checkout ${branch}`
198
198
  } catch ( err ) {
@@ -261,7 +261,6 @@ const promptForVersion = async ( currentVersion ) => {
261
261
  }
262
262
 
263
263
  const getVersion = async ( { branch, packagePath } ) => {
264
- await checkoutToBranch( branch )
265
264
  const currentVersion = await getPackageJsonVersion( packagePath )
266
265
  return promptForVersion( currentVersion )
267
266
  }
@@ -359,14 +358,14 @@ const updateNpmPackageJsonAndLock = async ( config ) => {
359
358
 
360
359
  try {
361
360
  if ( !isPackageInRepositoryRoot ) {
362
- await $`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.nothrow()
361
+ await $`npm version --no-git-tag-version ${version} --prefix ${packagePath}`.quiet().nothrow()
363
362
  if ( isWorkspace ) {
364
363
  await $`npm install`
365
364
  } else {
366
365
  await $`npm install --prefix ${packagePath}`
367
366
  }
368
367
  } else {
369
- await $`npm version --no-git-tag-version ${version}`.nothrow()
368
+ await $`npm version --no-git-tag-version ${version}`.quiet().nothrow()
370
369
  }
371
370
  } catch ( err ) {
372
371
  console.log( err.stderr || err )
@@ -377,7 +376,7 @@ const updateNpmPackageJsonAndLock = async ( config ) => {
377
376
  const createNewBuildCommit = async ( { buildMessage } ) => {
378
377
  try {
379
378
  await $`git add .`
380
- await $`git commit -m ${buildMessage}`
379
+ await $`git commit --allow-empty -m ${buildMessage}`
381
380
  } catch ( err ) {
382
381
  console.log( err.stderr || err )
383
382
  process.exit( 1 )
@@ -591,6 +590,8 @@ config.repositoryRoot = await getGitRootDirectory()
591
590
 
592
591
  config.branch = args.branch || await getBranch( { branchFilter : args['branch-filter'] } )
593
592
 
593
+ await checkoutToBranch( config )
594
+
594
595
  const argsPackagePath = args['package-path'] && path.join( config.repositoryRoot, args['package-path'] )
595
596
  config.packagePath = argsPackagePath || await getPackagePath( config )
596
597