forked from rome/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit-rome
More file actions
executable file
·29 lines (22 loc) · 782 Bytes
/
Copy pathcommit-rome
File metadata and controls
executable file
·29 lines (22 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
require('./_setup.cjs');
const {root} = require('./_constants.cjs');
const {execNode, unlink} = require('./_utils.cjs');
const path = require('path');
const fs = require('fs');
const os = require('os');
const TEMP_DIR = path.join(os.tmpdir(), 'vendor-rome');
execNode([path.join(__dirname, 'build-release'), TEMP_DIR]);
const VENDOR_ROME = path.join(root, 'scripts/vendor/rome.cjs');
fs.copyFileSync(path.join(TEMP_DIR, 'bin/rome/index.js'), VENDOR_ROME);
fs.copyFileSync(
path.join(TEMP_DIR, 'bin/rome/index.js.map'),
`${VENDOR_ROME}.map`,
);
unlink(TEMP_DIR);