@@ -7,6 +7,8 @@ var scopedVersion = process.argv[2];
77console . log ( `Packing nativescript-angular package with @nativescript/angular: ${ scopedVersion } ` ) ;
88
99const distFolderPath = path . resolve ( "../../dist" ) ;
10+ const outFileName = "nativescript-angular-compat.tgz" ;
11+
1012const nsAngularPackagePath = path . resolve ( "../../nativescript-angular-package" ) ;
1113const packageJsonPath = path . resolve ( `${ nsAngularPackagePath } /package.json` ) ;
1214console . log ( "Getting package.json from" , packageJsonPath ) ;
@@ -16,18 +18,18 @@ const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding
1618packageJsonObject . dependencies [ "@nativescript/angular" ] = scopedVersion ;
1719fs . writeFileSync ( packageJsonPath , JSON . stringify ( packageJsonObject , null , 4 ) ) ;
1820
19- // create .tgz in dist folder
2021execSync ( `npm install` , {
2122 cwd : nsAngularPackagePath
2223} ) ;
23- // ensures empty ../dist folder
24+
25+ // ensure empty dist folder
2426fs . emptyDirSync ( distFolderPath ) ;
25- // cd to dist folder
27+
28+ // create .tgz
2629execSync ( `npm pack ${ nsAngularPackagePath } ` , {
2730 cwd : distFolderPath
2831} ) ;
2932
30- const fileName = fs . readdirSync ( distFolderPath ) [ 0 ] ;
31- const newName = "nativescript-angular-compat.tgz" ;
33+ const currentFileName = fs . readdirSync ( distFolderPath ) [ 0 ] ;
3234// rename file
33- fs . moveSync ( `${ distFolderPath } /${ fileName } ` , `${ distFolderPath } /${ newName } ` ) ;
35+ fs . moveSync ( `${ distFolderPath } /${ currentFileName } ` , `${ distFolderPath } /${ outFileName } ` ) ;
0 commit comments