Skip to content

Commit 6ae1657

Browse files
subsetparkclaude
andcommitted
sqlite3: align -init guard with the no-SQL guard's null check
`options.init` is `string | null`. Using `!== null` (instead of a truthy check) means `-init ""` actually attempts the read and surfaces a clear "cannot open" error, matching the no-SQL guard below which already treats an explicit empty string as "provided". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4132293 commit 6ae1657

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/just-bash/src/commands/sqlite3/sqlite3.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,11 @@ export const sqlite3Command: Command = {
540540
if (options.cmd) {
541541
sql = options.cmd + (sql ? `; ${sql}` : "");
542542
}
543-
if (options.init) {
543+
// `options.init` is `string | null`. Use `!== null` (not falsiness) so
544+
// `-init ""` attempts the read and surfaces a clear error, instead of
545+
// silently skipping. This matches the no-SQL guard below, which also
546+
// treats an explicit empty string as "provided".
547+
if (options.init !== null) {
544548
try {
545549
const initPath = ctx.fs.resolvePath(ctx.cwd, options.init);
546550
const initContent = await ctx.fs.readFile(initPath);

0 commit comments

Comments
 (0)