Skip to content

Commit f21ef8c

Browse files
committed
impr(cli): simplify option handling
1 parent 9cd2230 commit f21ef8c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/typegpu-cli/src/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function createProject(cwd: string, options?: CreateProjectOptions)
6060
getDefaultPackageName(cwd, projectName) ??
6161
(nonInteractive ? undefined : await getPackageName());
6262

63-
if (!packageName || !isValidPackageName(packageName)) {
63+
if (!packageName) {
6464
failAndExit(
6565
`Cannot infer a valid package name from ${projectName}. Choose a valid project directory name.`,
6666
);

packages/typegpu-cli/src/utils/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export async function scaffoldProject(
9595
const pkgs = packageNames
9696
? packageNames.map((pkgName) => ({ pkg: pkgName, ver: VERSION }))
9797
: await multiselectPkgs(pkg);
98-
if (pkgs) {
98+
if (pkgs?.length) {
9999
pkg.dependencies ??= {};
100100
for (const { pkg: dep, ver } of pkgs) {
101101
if (!hasDependency(pkg, dep)) {

0 commit comments

Comments
 (0)