Skip to content

Commit

Permalink
fix: env issue importing remote video source (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Oct 24, 2023
1 parent 841d57d commit dd2bd03
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env node
import process from 'node:process';
import path from 'node:path';
import nextEnv from '@next/env';
import log from './logger.js';

nextEnv.loadEnvConfig(process.cwd(), undefined, log);

import yargs from 'yargs/yargs';

import * as init from './cli/init.js';
import * as sync from './cli/sync.js';

nextEnv.loadEnvConfig(process.cwd(), undefined, log);

yargs(process.argv.slice(2)).command(init).command(sync).demandCommand().help().argv;

// Import the app's next.config.js file so the env variables
// __NEXT_VIDEO_OPTS set in with-next-video can be used.
import(path.resolve('next.config.js'))
.catch(() => log.error('Failed to load next.config.js'));

0 comments on commit dd2bd03

Please sign in to comment.