@leeguoo/wrangler-accounts 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bin/wrangler-accounts.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,3 +75,4 @@ The profiles directory defaults to:
|
|
|
75
75
|
|
|
76
76
|
- Profile names accept only letters, numbers, dot, underscore, and dash.
|
|
77
77
|
- On `use`, the current config is backed up into `__backup-YYYYMMDD-HHMMSS` unless you pass `--no-backup`.
|
|
78
|
+
- `login <name>` overwrites an existing profile with the same name.
|
package/bin/wrangler-accounts.js
CHANGED
|
@@ -350,8 +350,11 @@ function main() {
|
|
|
350
350
|
if (!fs.existsSync(configPath)) {
|
|
351
351
|
die(`Config file not found after login: ${configPath}`);
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
const profileDir = path.join(profilesDir, name);
|
|
354
|
+
const existed = fs.existsSync(profileDir);
|
|
355
|
+
saveProfile(name, configPath, profilesDir, true);
|
|
356
|
+
const note = existed ? " (overwritten)" : "";
|
|
357
|
+
console.log(`Logged in and saved profile '${name}' from ${configPath}${note}`);
|
|
355
358
|
return;
|
|
356
359
|
}
|
|
357
360
|
|