Browse Source

build: remove the tools folder (#24880)

Samuel Attard 4 years ago
parent
commit
433956ce4f
5 changed files with 19 additions and 19 deletions
  1. 1 1
      BUILD.gn
  2. 0 0
      build/js2c.py
  3. 17 0
      script/run-if-exists.js
  4. 1 1
      spec/package.json
  5. 0 17
      tools/run-if-exists.js

+ 1 - 1
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)

+ 0 - 0
tools/js2c.py → build/js2c.py


+ 17 - 0
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));
+}

+ 1 - 1
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",

+ 0 - 17
tools/run-if-exists.js

@@ -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))
-}