threadlines 0.1.25 → 0.1.27
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/dist/commands/check.js +11 -3
- package/package.json +1 -1
package/dist/commands/check.js
CHANGED
|
@@ -49,16 +49,24 @@ const context_2 = require("../git/context");
|
|
|
49
49
|
const fs = __importStar(require("fs"));
|
|
50
50
|
const path = __importStar(require("path"));
|
|
51
51
|
const chalk_1 = __importDefault(require("chalk"));
|
|
52
|
+
// Get CLI version from package.json
|
|
53
|
+
const packageJsonPath = path.join(__dirname, '../../package.json');
|
|
54
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
55
|
+
const CLI_VERSION = packageJson.version;
|
|
52
56
|
async function checkCommand(options) {
|
|
53
57
|
const repoRoot = process.cwd();
|
|
54
|
-
console.log(chalk_1.default.blue(
|
|
58
|
+
console.log(chalk_1.default.blue(`🔍 Threadline CLI v${CLI_VERSION}: Checking code against your threadlines...\n`));
|
|
55
59
|
// Pre-flight check: Validate ALL required environment variables at once
|
|
56
60
|
const apiKey = (0, config_1.getThreadlineApiKey)();
|
|
57
61
|
const account = (0, config_1.getThreadlineAccount)();
|
|
62
|
+
// Debug: Show what we got (masked for security)
|
|
63
|
+
console.log(chalk_1.default.gray(` [Debug] THREADLINE_API_KEY: ${apiKey ? `"${apiKey.substring(0, 4)}..."` : 'undefined'}`));
|
|
64
|
+
console.log(chalk_1.default.gray(` [Debug] THREADLINE_ACCOUNT: ${account ? `"${account.substring(0, 4)}..."` : 'undefined'}`));
|
|
58
65
|
const missingVars = [];
|
|
59
|
-
|
|
66
|
+
// Check for undefined, empty string, or literal unexpanded variable
|
|
67
|
+
if (!apiKey || apiKey.startsWith('$'))
|
|
60
68
|
missingVars.push('THREADLINE_API_KEY');
|
|
61
|
-
if (!account)
|
|
69
|
+
if (!account || account.startsWith('$'))
|
|
62
70
|
missingVars.push('THREADLINE_ACCOUNT');
|
|
63
71
|
if (missingVars.length > 0) {
|
|
64
72
|
console.error(chalk_1.default.red('❌ Error: Missing required environment variables:'));
|