@leverege/build-tools 2.32.3 → 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
  };
@@ -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
  };
@@ -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.3",
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
  }
@@ -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