Skip to content

Commit f4d4b42

Browse files
committed
PDPDEVTOOL-4753 remove copy to temp directory
1 parent 1cea366 commit f4d4b42

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/node-cli/src/core/sdksetup/SdkLicense.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
'use strict';
2-
const fs = require('fs');
32
const os = require('os');
43
const path = require('path');
54
const { 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');
97
const WINDOWS_PLATFORM = 'win32';
108
const LINUX_PLATFORM = 'linux';
119
const 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

Comments
 (0)