@@ -7,6 +7,8 @@ var scopedVersion = process.argv[2];
7
7
console . log ( `Packing nativescript-angular package with @nativescript/angular: ${ scopedVersion } ` ) ;
8
8
9
9
const distFolderPath = path . resolve ( "../../dist" ) ;
10
+ const outFileName = "nativescript-angular-compat.tgz" ;
11
+
10
12
const nsAngularPackagePath = path . resolve ( "../../nativescript-angular-package" ) ;
11
13
const packageJsonPath = path . resolve ( `${ nsAngularPackagePath } /package.json` ) ;
12
14
console . log ( "Getting package.json from" , packageJsonPath ) ;
@@ -16,18 +18,18 @@ const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding
16
18
packageJsonObject . dependencies [ "@nativescript/angular" ] = scopedVersion ;
17
19
fs . writeFileSync ( packageJsonPath , JSON . stringify ( packageJsonObject , null , 4 ) ) ;
18
20
19
- // create .tgz in dist folder
20
21
execSync ( `npm install` , {
21
22
cwd : nsAngularPackagePath
22
23
} ) ;
23
- // ensures empty ../dist folder
24
+
25
+ // ensure empty dist folder
24
26
fs . emptyDirSync ( distFolderPath ) ;
25
- // cd to dist folder
27
+
28
+ // create .tgz
26
29
execSync ( `npm pack ${ nsAngularPackagePath } ` , {
27
30
cwd : distFolderPath
28
31
} ) ;
29
32
30
- const fileName = fs . readdirSync ( distFolderPath ) [ 0 ] ;
31
- const newName = "nativescript-angular-compat.tgz" ;
33
+ const currentFileName = fs . readdirSync ( distFolderPath ) [ 0 ] ;
32
34
// rename file
33
- fs . moveSync ( `${ distFolderPath } /${ fileName } ` , `${ distFolderPath } /${ newName } ` ) ;
35
+ fs . moveSync ( `${ distFolderPath } /${ currentFileName } ` , `${ distFolderPath } /${ outFileName } ` ) ;
0 commit comments