#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const os = require('os'); const { spawnSync } = require('child_process'); function candidates() { return [ path.resolve(__dirname, '..', '..', 'scripts', 'tools', 'douyin-video-transcriber.js'), path.join(os.homedir(), '.openclaw', 'workspace', 'scripts', 'tools', 'douyin-video-transcriber.js'), path.join(os.homedir(), '.openclaw', 'tools', 'douyin-video-transcriber.js'), path.resolve(process.cwd(), 'scripts', 'tools', 'douyin-video-transcriber.js') ]; } const target = candidates().find(filePath => fs.existsSync(filePath)); if (!target) { console.error('douyin-video-transcript entrypoint was not found.'); console.error('Expected one of:'); candidates().forEach(filePath => console.error(`- ${filePath}`)); process.exit(1); } const child = spawnSync(process.execPath, [target, ...process.argv.slice(2)], { cwd: process.cwd(), env: process.env, stdio: 'inherit' }); if (child.error) { console.error(child.error.message); process.exit(1); } process.exit(child.status ?? 0);