mydata-cli
Advanced tools
+19
-0
@@ -5,3 +5,8 @@ import { Command } from "commander"; | ||
| import readline from "readline"; | ||
| import fs from "fs"; | ||
| import path from "path"; | ||
| const GITIGNORE = path.join(process.cwd(), ".gitignore"); | ||
| const CONFIG_LINE = ".mycli-config.json"; | ||
| const login = new Command("login") | ||
@@ -14,2 +19,3 @@ .description("Login to your account") | ||
| }); | ||
| rl.question("Email: ", (email) => { | ||
@@ -28,2 +34,14 @@ rl.question("Password: ", async (password) => { | ||
| console.log("✅ Login successful!"); | ||
| // --- Add .mycli-config.json to .gitignore --- | ||
| if (!fs.existsSync(GITIGNORE)) { | ||
| fs.writeFileSync(GITIGNORE, CONFIG_LINE + "\n"); | ||
| console.log("📝 Created .gitignore and added .mycli-config.json"); | ||
| } else { | ||
| const current = fs.readFileSync(GITIGNORE, "utf8").split("\n"); | ||
| if (!current.includes(CONFIG_LINE)) { | ||
| fs.appendFileSync(GITIGNORE, CONFIG_LINE + "\n"); | ||
| console.log("🛡️ Added .mycli-config.json to .gitignore"); | ||
| } | ||
| } | ||
| } catch (err) { | ||
@@ -35,2 +53,3 @@ console.error( | ||
| } | ||
| rl.close(); | ||
@@ -37,0 +56,0 @@ }); |
+1
-1
| { | ||
| "name": "mydata-cli", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+1
-1
| import fs from "fs-extra"; | ||
| const configPath = "./mycli-config.json"; | ||
| const configPath = "./.mycli-config.json"; | ||
@@ -4,0 +4,0 @@ export function saveToken(token) { |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
19256
3.92%560
2.75%6
20%