content-grade 1.0.44 → 1.0.45
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/bin/content-grade.js +10 -5
- package/package.json +1 -1
package/bin/content-grade.js
CHANGED
|
@@ -990,7 +990,10 @@ async function cmdActivate() {
|
|
|
990
990
|
blank();
|
|
991
991
|
|
|
992
992
|
const existing = getLicenseKey();
|
|
993
|
-
|
|
993
|
+
// If a new key is passed explicitly, allow re-activation (tier upgrades, replacements).
|
|
994
|
+
// If called with no args and a key is already stored, show status and return.
|
|
995
|
+
const newKeyArg = args[1] && args[1].length >= 8 ? args[1] : null;
|
|
996
|
+
if (existing && !newKeyArg) {
|
|
994
997
|
ok(`Pro license already activated`);
|
|
995
998
|
blank();
|
|
996
999
|
console.log(` ${D}Key: ${existing.slice(0, 8)}...${R}`);
|
|
@@ -1000,6 +1003,8 @@ async function cmdActivate() {
|
|
|
1000
1003
|
console.log(` ${D} content-grade batch ./posts/ ${R}${D}# analyze all files in a directory${R}`);
|
|
1001
1004
|
console.log(` ${D} Unlimited analyses (vs 15 free total)${R}`);
|
|
1002
1005
|
blank();
|
|
1006
|
+
console.log(` ${D}To activate a different key: ${CY}content-grade activate <new-key>${R}`);
|
|
1007
|
+
blank();
|
|
1003
1008
|
return;
|
|
1004
1009
|
}
|
|
1005
1010
|
|
|
@@ -1009,10 +1014,10 @@ async function cmdActivate() {
|
|
|
1009
1014
|
blank();
|
|
1010
1015
|
|
|
1011
1016
|
let key;
|
|
1012
|
-
if (
|
|
1013
|
-
key =
|
|
1017
|
+
if (newKeyArg) {
|
|
1018
|
+
key = newKeyArg;
|
|
1014
1019
|
blank();
|
|
1015
|
-
console.log(` ${D}Using provided key: ${
|
|
1020
|
+
console.log(` ${D}Using provided key: ${newKeyArg.slice(0, 8)}...${R}`);
|
|
1016
1021
|
blank();
|
|
1017
1022
|
} else {
|
|
1018
1023
|
process.stdout.write(` ${CY}License key:${R} `);
|
|
@@ -1112,7 +1117,7 @@ async function cmdActivate() {
|
|
|
1112
1117
|
config.activatedAt = new Date().toISOString();
|
|
1113
1118
|
saveConfig(config);
|
|
1114
1119
|
|
|
1115
|
-
recordEvent({ event: 'license_activated', tier: activatedTier });
|
|
1120
|
+
recordEvent({ event: existing ? 'license_reactivated' : 'license_activated', tier: activatedTier });
|
|
1116
1121
|
|
|
1117
1122
|
// Also write canonical license file to ~/.content-grade/license.json
|
|
1118
1123
|
mkdirSync(LICENSE_DIR, { recursive: true });
|
package/package.json
CHANGED