Files
wehub-resource-sync 98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:40:49 +08:00

36 lines
1.1 KiB
JavaScript
Executable File

#!/usr/bin/env node
import { execFileSync } from 'child_process';
import { fileURLToPath } from 'url';
import { join, dirname } from 'path';
// Check if we're already running with the flags
const hasNoWarnings = process.execArgv.includes('--no-warnings');
const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
if (!hasNoWarnings || !hasNoDeprecation) {
// Get path to the actual CLI entrypoint
const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
const entrypoint = join(projectRoot, 'dist', 'index.mjs');
// Execute the actual CLI directly with the correct flags
try {
execFileSync(process.execPath, [
'--no-warnings',
'--no-deprecation',
entrypoint,
...process.argv.slice(2)
], {
stdio: 'inherit',
env: process.env
});
} catch (error) {
// execFileSync throws if the process exits with non-zero
process.exit(error.status || 1);
}
} else {
// We're running Node with the flags we wanted, import the CLI entrypoint
// module to avoid creating a new process.
import("../dist/index.mjs");
}