mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: fix build on win (#10022)
This commit is contained in:
parent
fe0c74bd52
commit
e3f8ff23c3
@ -23,7 +23,7 @@
|
||||
},
|
||||
"wireit": {
|
||||
"build": {
|
||||
"command": "tsc -b && chmod a+x lib/cjs/main-cli.js lib/esm/main-cli.js",
|
||||
"command": "tsc -b && tsx ../../tools/chmod.ts 755 lib/cjs/main-cli.js lib/esm/main-cli.js",
|
||||
"files": [
|
||||
"src/**/*.ts",
|
||||
"tsconfig.json"
|
||||
|
@ -46,7 +46,7 @@
|
||||
},
|
||||
"wireit": {
|
||||
"prepack": {
|
||||
"command": "cp ../../README.md README.md",
|
||||
"command": "tsx ../../tools/cp.ts ../../README.md README.md",
|
||||
"files": [
|
||||
"../../README.md"
|
||||
],
|
||||
|
@ -42,7 +42,7 @@
|
||||
},
|
||||
"wireit": {
|
||||
"prepack": {
|
||||
"command": "cp ../../README.md README.md",
|
||||
"command": "tsx ../../tools/cp.ts ../../README.md README.md",
|
||||
"files": [
|
||||
"../../README.md"
|
||||
],
|
||||
|
27
tools/chmod.ts
Normal file
27
tools/chmod.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2023 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
/**
|
||||
* Calls chmod with the mode in argv[2] on paths in argv[3...length-1].
|
||||
*/
|
||||
|
||||
const mode = process.argv[2];
|
||||
|
||||
for (let i = 3; i < process.argv.length; i++) {
|
||||
fs.chmodSync(process.argv[i], mode);
|
||||
}
|
22
tools/cp.ts
Normal file
22
tools/cp.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2023 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
/**
|
||||
* Copies single file in argv[2] to argv[3]
|
||||
*/
|
||||
fs.cpSync(process.argv[2], process.argv[3]);
|
Loading…
Reference in New Issue
Block a user