diff --git a/lib/cmd-fns/init/get-generated-readme.ts b/lib/cmd-fns/init/get-generated-readme.ts index dff1267c..77eb9cba 100644 --- a/lib/cmd-fns/init/get-generated-readme.ts +++ b/lib/cmd-fns/init/get-generated-readme.ts @@ -8,10 +8,12 @@ export const getGeneratedReadme = ({ return ` # ${name} -[![tscircuit version badge](https://registry.tscircuit.com/badges/view?package_name=${name.replace( - "/", - "." - )})](https://registry.tscircuit.com/${name.replace("@", "")}) +[![tscircuit version badge](https://registry-api.tscircuit.com/badges/view?package_name=${name + .replace("@", "") + .replace("/", ".")})](https://registry.tscircuit.com/${name.replace( + "@", + "" + )}) ${ shouldHaveProjectGeneratedNotice diff --git a/lib/cmd-fns/init/index.ts b/lib/cmd-fns/init/index.ts index ec4bb44b..e9c7548a 100644 --- a/lib/cmd-fns/init/index.ts +++ b/lib/cmd-fns/init/index.ts @@ -35,7 +35,11 @@ export const initCmd = async (ctx: AppContext, args: any) => { const myAccount = await ctx.axios .get("/accounts/get") .then((r) => r.data.account) - params.name = `@${myAccount.github_username}/${Path.basename(params.dir)}` + let subName = Path.basename(params.dir) + if (subName === ".") { + subName = Path.basename(Path.resolve(Path.join(subName, ".."))) + } + params.name = `@${myAccount.github_username}/${subName}` } catch (e) { params.name = Path.basename(params.dir ?? ctx.cwd) }