Closed kddige closed 1 year ago
Update: I've managed to resolve the issue by making the following change:
In the file: utils.ts at b5b8234
I added:
export const runCommand = async (command: string, args: string[]) => {
const formattedArgs = args.filter((a) => a !== ""); // <- Filter out any literal empty string arugment -, if an empty string argument is needed it should be passed explicitly as ["arg1", "arg2", '""'] or ["\"\""]
try {
await execa(command, formattedArgs, { stdio: "inherit" });
} catch (error) {
throw new Error(
`command "${command} ${formattedArgs.join(" ")}" exited with code ${error.code}`
);
}
};
It seems execa treats any empty string arguments, as a literal argument: "", this caused execa to run bun add
as:
bun add -D drizzle drizzle-orm drizzle-zod zod mysql2 "" <-- the "" here was the problem
While this issue can potentially be addressed at a higher level than the runCommand function, I'm inclined to believe that no argument would necessitate an empty string, if none is explicit passed?
Would appreciate your thoughts on this, i have also opened a PR here: https://github.com/nicoalbanese/kirimase/pull/19
Thanks @kddige - I've merged it into main. Appreciate you sorting it out.
Bun still failing with Sqlite push command. I'm going to hold off including bun for now given the issues, and hopefully in next few days there will be a resolution!
0.0.13 now adds support for bun. It's almost fully supported, however I've had to remove the ability to use sqlite with drizzle as drizzle-kit's sqlite driver doesn't yet support bun.
Description: When using
bun
as a package manager in conjunction with certain package and database options, the dependency installation occasionally fails.Steps to reproduce:
kirimase init
.bun
.drizzle
.mysql
.Mysql2
.Possible Cause and Solution: I suspect that the underlying issue might stem from the trailing space at the end of the command. A potential fix could involve trimming the command string before execution.
Next Steps: I'm currently looking into this problem. I'll open a PR once I've found a solution.