From 433956ce4fa49d3471575b8b3954b20fbab216fa Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 7 Aug 2020 14:13:09 -0700 Subject: [PATCH] build: remove the tools folder (#24880) --- BUILD.gn | 2 +- {tools => build}/js2c.py | 0 script/run-if-exists.js | 17 +++++++++++++++++ spec/package.json | 2 +- tools/run-if-exists.js | 17 ----------------- 5 files changed, 19 insertions(+), 19 deletions(-) rename {tools => build}/js2c.py (100%) create mode 100644 script/run-if-exists.js delete mode 100644 tools/run-if-exists.js diff --git a/BUILD.gn b/BUILD.gn index 1e270ed15e5b..5841c3fa7e99 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -170,7 +170,7 @@ action("electron_js2c") { inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ] outputs = [ "$root_gen_dir/electron_natives.cc" ] - script = "tools/js2c.py" + script = "build/js2c.py" args = [ rebase_path("//third_party/electron_node") ] + rebase_path(outputs, root_build_dir) + rebase_path(sources, root_build_dir) diff --git a/tools/js2c.py b/build/js2c.py similarity index 100% rename from tools/js2c.py rename to build/js2c.py diff --git a/script/run-if-exists.js b/script/run-if-exists.js new file mode 100644 index 000000000000..93e2252fc9bb --- /dev/null +++ b/script/run-if-exists.js @@ -0,0 +1,17 @@ +const cp = require('child_process'); +const fs = require('fs'); + +const checkPath = process.argv[2]; +const command = process.argv.slice(3); + +if (fs.existsSync(checkPath)) { + const child = cp.spawn( + `${command[0]}${process.platform === 'win32' ? '.cmd' : ''}`, + command.slice(1), + { + stdio: 'inherit', + cwd: checkPath + } + ); + child.on('exit', code => process.exit(code)); +} diff --git a/spec/package.json b/spec/package.json index 0aedce766c30..af90bb205e90 100644 --- a/spec/package.json +++ b/spec/package.json @@ -4,7 +4,7 @@ "main": "static/main.js", "version": "0.1.0", "scripts": { - "postinstall": "node ../tools/run-if-exists.js node_modules/robotjs node-gyp rebuild" + "postinstall": "node ../script/run-if-exists.js node_modules/robotjs node-gyp rebuild" }, "devDependencies": { "basic-auth": "^2.0.1", diff --git a/tools/run-if-exists.js b/tools/run-if-exists.js deleted file mode 100644 index 61ca2ea6cfe1..000000000000 --- a/tools/run-if-exists.js +++ /dev/null @@ -1,17 +0,0 @@ -const cp = require('child_process') -const fs = require('fs') - -const checkPath = process.argv[2] -const command = process.argv.slice(3) - -if (fs.existsSync(checkPath)) { - const child = cp.spawn( - `${command[0]}${process.platform === 'win32' ? '.cmd' :''}`, - command.slice(1), - { - stdio: 'inherit', - cwd: checkPath - } - ) - child.on('exit', code => process.exit(code)) -}