@@ -25,6 +25,7 @@ const {
2525const forEachPackage = require ( '../for-each-package' ) ;
2626const checkForGitChanges = require ( '../check-for-git-changes' ) ;
2727const bumpPackageVersion = require ( './bump-package-version' ) ;
28+ const detectPackageUnreleasedChanges = require ( './bump-utils' ) ;
2829
2930const ROOT_LOCATION = path . join ( __dirname , '..' , '..' , '..' ) ;
3031
@@ -37,41 +38,6 @@ const {
3738 } )
3839 . strict ( ) ;
3940
40- const detectPackageUnreleasedChanges = (
41- packageRelativePathFromRoot ,
42- packageName ,
43- ) => {
44- const hashOfLastCommitInsidePackage = exec (
45- `git log -n 1 --format=format:%H -- ${ packageRelativePathFromRoot } ` ,
46- { cwd : ROOT_LOCATION , silent : true } ,
47- ) . stdout . trim ( ) ;
48-
49- const hashOfLastCommitThatChangedVersion = exec (
50- `git log -G\\"version\\": --format=format:%H -n 1 -- ${ packageRelativePathFromRoot } /package.json` ,
51- { cwd : ROOT_LOCATION , silent : true } ,
52- ) . stdout . trim ( ) ;
53-
54- if ( hashOfLastCommitInsidePackage === hashOfLastCommitThatChangedVersion ) {
55- echo (
56- `\uD83D\uDD0E No changes for package ${ chalk . green (
57- packageName ,
58- ) } since last version bump`,
59- ) ;
60- return false ;
61- } else {
62- echo ( `\uD83D\uDCA1 Found changes for ${ chalk . yellow ( packageName ) } :` ) ;
63- exec (
64- `git log --pretty=oneline ${ hashOfLastCommitThatChangedVersion } ..${ hashOfLastCommitInsidePackage } ${ packageRelativePathFromRoot } ` ,
65- {
66- cwd : ROOT_LOCATION ,
67- } ,
68- ) ;
69- echo ( ) ;
70-
71- return true ;
72- }
73- } ;
74-
7541const buildExecutor =
7642 ( packageAbsolutePath , packageRelativePathFromRoot , packageManifest ) =>
7743 async ( ) => {
@@ -249,5 +215,3 @@ const main = async () => {
249215} ;
250216
251217main ( ) ;
252-
253- module . exports = { detectPackageUnreleasedChanges} ;
0 commit comments