forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.ts
More file actions
40 lines (36 loc) · 1.09 KB
/
Copy pathsync.ts
File metadata and controls
40 lines (36 loc) · 1.09 KB
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
30
31
32
33
34
35
36
37
38
39
40
/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Wrapper script for fork-sync that points to the react-native-windows root.
*
* Usage:
* node packages/@rnw-scripts/fork-sync/lib-commonjs/sync.js --dep fmt
* node packages/@rnw-scripts/fork-sync/lib-commonjs/sync.js --dep fmt --status
* node packages/@rnw-scripts/fork-sync/lib-commonjs/sync.js --dep fmt --continue
*
* All arguments are forwarded to fork-sync with `-C` prepended
* so it finds the sync-manifest.json in the repository root.
*
* @format
*/
import {execFileSync} from 'child_process';
import * as path from 'path';
const syncScript = path.join(
__dirname,
'..',
'node_modules',
'@rnx-kit',
'fork-sync',
'lib',
'sync.js',
);
const repoRoot = path.join(__dirname, '..', '..', '..', '..');
const args = [syncScript, '-C', repoRoot, ...process.argv.slice(2)];
try {
execFileSync('node', args, {stdio: 'inherit'});
} catch (e: unknown) {
// execFileSync throws on non-zero exit; stdio is already inherited
const err = e as {status?: number};
process.exit(err.status ?? 1);
}