1+ const debug = require ( 'debug' ) ( 'workspace-resolver' ) ;
12const _ = require ( 'lodash' ) ;
23const join = require ( 'path' ) . join ;
34const writeJsonFile = require ( 'write-json-file' ) ;
@@ -6,11 +7,13 @@ const resolver = {
67 postAction ( source , rootDir , repoHash , deployConfigPath , tools ) {
78 const config = require ( deployConfigPath ) ;
89 const resolvedApps = _ . map ( config . apps , ( app ) => {
9- app . path = join ( rootDir , app . path ) ;
10- app . source . path = join ( rootDir , app . source . path ) ;
11- app . scripts = _ . mapValues ( app . scripts , ( value , key ) => {
12- return _ . map ( value , ( script ) => script . replace ( '${rootDir}' , rootDir ) ) ;
13- } ) ;
10+ if ( tools . repoHash ( app . source ) === repoHash ) {
11+ app . path = join ( rootDir , app . path ) ;
12+ app . source . path = join ( rootDir , app . source . path ) ;
13+ app . scripts = _ . mapValues ( app . scripts , ( value , key ) => {
14+ return _ . map ( value , ( script ) => script . replace ( '${rootDir}' , rootDir ) ) ;
15+ } ) ;
16+ }
1417 return app ;
1518 } ) ;
1619 config . apps = resolvedApps ;
0 commit comments