11'use strict' ;
2- const fs = require ( 'fs' ) ;
32const os = require ( 'os' ) ;
43const path = require ( 'path' ) ;
54const { spawnSync } = require ( 'child_process' ) ;
65
7- const LICENSE_FILENAME = 'FUTC-LICENSE.txt' ;
8- const LICENSE_PATH = path . normalize ( './resources/' + LICENSE_FILENAME ) ;
6+ const LICENSE_PATH = path . normalize ( './resources/FUTC-LICENSE.txt' ) ;
97const WINDOWS_PLATFORM = 'win32' ;
108const LINUX_PLATFORM = 'linux' ;
119const OSX_PLATFORM = 'darwin' ;
@@ -27,14 +25,9 @@ class SdkLicense {
2725 if ( process . env . npm_config_acceptsuitecloudsdklicense || process . env . npm_config_acceptSuiteCloudSDKLicense ) {
2826 return ;
2927 }
30- const tmpFilePath = os . tmpdir ( ) + path . sep + LICENSE_FILENAME ;
31- const fileExists = fs . lstatSync ( tmpFilePath , { throwIfNoEntry : false } ) ;
32- if ( ! fileExists ) {
33- fs . copyFileSync ( LICENSE_PATH , tmpFilePath ) ;
34- }
3528 const currentPlatform = os . platform ( ) ;
3629 const command = supportedPlatformsCommands [ currentPlatform ] ;
37- const execution = spawnSync ( command , [ tmpFilePath ] , { stdio : 'ignore' , detached : true , shell : true } ) ;
30+ const execution = spawnSync ( command , [ LICENSE_PATH ] , { stdio : 'ignore' , detached : true , shell : true } ) ;
3831 if ( execution . error || execution . status !== 0 ) {
3932 console . error ( ERROR_MESSAGE ) ;
4033 console . error ( LICENSE_MESSAGE ) ;
0 commit comments