fix: give permissions to run cn.js
This commit is contained in:
parent
db96a9eb6f
commit
b29de66657
2 changed files with 11 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import * as esbuild from "esbuild";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { readFileSync, writeFileSync, chmodSync } from "fs";
|
||||
import { resolve, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
|
|
@ -86,6 +86,9 @@ const require = createRequire(import.meta.url);`,
|
|||
|
||||
// Create wrapper script with shebang
|
||||
writeFileSync("dist/cn.js", "#!/usr/bin/env node\nimport('./index.js');");
|
||||
|
||||
// Make the wrapper script executable
|
||||
chmodSync("dist/cn.js", 0o755);
|
||||
|
||||
// Calculate bundle size
|
||||
const bundleSize = result.metafile.outputs["dist/index.js"].bytes;
|
||||
|
|
|
|||
|
|
@ -118,9 +118,14 @@ runTest("Local packages are bundled", () => {
|
|||
}
|
||||
|
||||
// Check for code from @continuedev/openai-adapters
|
||||
// Since the bundle is minified, check for strings that would be present
|
||||
// even after minification (e.g., error messages, property names)
|
||||
if (
|
||||
!bundleContent.includes("BaseLlmApi") &&
|
||||
!bundleContent.includes("constructLlmApi")
|
||||
!bundleContent.includes("anthropic") &&
|
||||
!bundleContent.includes("gemini") &&
|
||||
!bundleContent.includes("openai") &&
|
||||
!bundleContent.includes("azure") &&
|
||||
!bundleContent.includes("bedrock")
|
||||
) {
|
||||
throw new Error("@continuedev/openai-adapters not properly bundled");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue