From 0d4e6f21c64b94b12d351afe632b02ba91e516e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Jaro=C5=A1?= <hello@romanjaros.dev>
Date: Sat, 9 Sep 2023 20:58:05 +0200
Subject: [PATCH] Update .npmrc

Change-Id: I3ffc186339c2124d39e88ee681448122f4bd9a6e
---
 .npmrc       | 2 +-
 create.js    | 7 +++++--
 package.json | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/.npmrc b/.npmrc
index 8cacf51..36285f0 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,3 +1,3 @@
 always-auth=true
 @prokyon:registry=https://npm.romanjaros.dev
-@toolkit:registry=https://npm.romanjaros.dev
\ No newline at end of file
+@toolkit:registry=https://npm.romanjaros.dev
diff --git a/create.js b/create.js
index b126be4..bed3345 100644
--- a/create.js
+++ b/create.js
@@ -8,8 +8,9 @@ const appName = argv.name ?? 'app';
 const appPort = argv.port ?? '0';
 const isMonorepo = argv.monorepo === 'T';
 
+const defaultContextDir = './';
 const rootDir = __dirname;
-const contextDir = `${argv._[0]}/` ?? './';
+const contextDir = `${argv._[0]}/` ?? defaultContextDir;
 
 // create app folder
 const appsDir = `${contextDir}/apps`;
@@ -42,7 +43,9 @@ try {
 }
 
 // rename internal files
-fs.unlinkSync('.npmrc');
+if (contextDir === defaultContextDir) {
+	fs.unlinkSync(`${contextDir}/.npmrc`);
+}
 fs.renameSync(`${contextDir}/npmrc`, `${contextDir}/.npmrc`);
 fs.renameSync(`${contextDir}/gitignore`, `${contextDir}/.gitignore`);
 fs.renameSync(`${contextDir}/prettierrc`, `${contextDir}/.prettierrc`);
diff --git a/package.json b/package.json
index 03c9bc6..0887ded 100644
--- a/package.json
+++ b/package.json
@@ -24,4 +24,4 @@
   "keywords": [],
   "author": "Roman Jaroš",
   "license": "ISC"
-}
+}
\ No newline at end of file