From 7c01e3534c79fe6920833598439e00bf7db8e8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=8C=8C=EB=A7=81?= Date: Thu, 30 Mar 2023 15:12:04 +0900 Subject: [PATCH] :bug: cannot run --- package.json | 2 +- src/index.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fe4aaa8..4fcad37 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "dev": "tsx src", - "build": "tsup", + "build": "tsup-node", "prepack": "pnpm build" }, "keywords": [], diff --git a/src/index.ts b/src/index.ts index 0047dba..00e51fb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,23 @@ -#!/bin/env node +#!/usr/bin/env node import { program } from 'commander' import chalk from 'chalk' import { PropertiesSchema } from './schema' import prettier from 'prettier' import fs from 'fs' -import { getPropertyType, propertyTypes } from './types' +import { getPropertyType } from './types' import path from 'path' await program.parseAsync() const url = program.args[0] +if (!url) { + console.error(chalk.red('Usage: adofai-typegen ')) + + process.exit(1) +} + console.log(chalk.blue`Fetching properties json`) const data: PropertiesSchema = await (await fetch(url)).json()