🔀 merge dev

This commit is contained in:
Tw93
2023-04-08 20:29:02 +08:00
38 changed files with 3162 additions and 973 deletions

11
bin/options/index.ts vendored
View File

@@ -3,15 +3,22 @@ import { getDomain } from '@/utils/url.js';
import { getIdentifier } from '../helpers/tauriConfig.js';
import { PakeAppOptions, PakeCliOptions } from '../types.js';
import { handleIcon } from './icon.js';
import fs from 'fs/promises';
export default async function handleOptions(options: PakeCliOptions, url: string): Promise<PakeAppOptions> {
const appOptions: PakeAppOptions = {
...options,
identifier: '',
};
const url_exists = await fs.stat(url)
.then(() => true)
.catch(() => false);
if (!appOptions.name) {
appOptions.name = await promptText('Please enter the name of your application.', getDomain(url));
if (!url_exists) {
appOptions.name = await promptText('please input your application name', getDomain(url));
} else {
appOptions.name = await promptText('please input your application name', "");
}
}
appOptions.identifier = getIdentifier(appOptions.name, url);