[go: up one dir, main page]

Skip to content

Commit

Permalink
fix(cli): update dev-core (toeverything#3296)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 authored Jul 19, 2023
1 parent 47f12f7 commit 1abcdee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ENABLE_PLUGIN=
ENABLE_TEST_PROPERTIES=
ENABLE_BC_PROVIDER=
CHANGELOG_URL=
ENABLE_PRELOADING=
ENABLE_NEW_SETTING_MODAL=
ENABLE_SQLITE_PROVIDER=
ENABLE_NEW_SETTING_UNSTABLE_API=
ENABLE_NOTIFICATION_CENTER=
ENABLE_CLOUD=
ENABLE_MOVE_DATABASE=
28 changes: 28 additions & 0 deletions packages/cli/src/bin/dev-core.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import { spawn } from 'node:child_process';
import { existsSync } from 'node:fs';
import path from 'node:path';

import * as p from '@clack/prompts';
import { config } from 'dotenv';

import { type BuildFlags, projectRoot } from '../config/index.js';

const files = ['.env', '.env.local'];

for (const file of files) {
if (existsSync(path.resolve(projectRoot, file))) {
config({
path: path.resolve(projectRoot, file),
});
console.log(`${file} loaded`);
break;
}
}

const cwd = path.resolve(projectRoot, 'apps', 'core');

const flags: BuildFlags = {
Expand All @@ -16,6 +30,19 @@ const flags: BuildFlags = {

const buildFlags = await p.group(
{
distribution: () =>
p.select({
message: 'Distribution',
options: [
{
value: 'browser',
},
{
value: 'desktop',
},
],
initialValue: 'browser',
}),
mode: () =>
p.select({
message: 'Mode',
Expand Down Expand Up @@ -59,6 +86,7 @@ const buildFlags = await p.group(
}
);

flags.distribution = buildFlags.distribution as any;
flags.mode = buildFlags.mode as any;
flags.channel = buildFlags.channel as any;
flags.coverage = buildFlags.coverage;
Expand Down

0 comments on commit 1abcdee

Please sign in to comment.