Skip to content

Commit

Permalink
fix: sheet command
Browse files Browse the repository at this point in the history
f3rno64 committed Dec 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent fc70de8 commit e7beb54
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/commands/sheet.ts
Original file line number Diff line number Diff line change
@@ -13,8 +13,7 @@ const COMMAND_CONFIG = {
aliases: ['s'],
builder: {
name: {
describe: 'Sheet name',
demandOption: true
describe: 'Sheet name'
},

delete: {
@@ -71,10 +70,9 @@ const handler = async (args: SheetCommandArgs) => {
const { name, entries } = sheet

if (entries.length === 0) {
console.log(
throw new Error(
`${C.clText('Sheet')} ${C.clSheet(name)} ${C.clText('has no entries')}`
)
return
}

P.printSheet(sheet, name === activeSheetName)
3 changes: 1 addition & 2 deletions src/db/delete.ts
Original file line number Diff line number Diff line change
@@ -11,8 +11,7 @@ const deleteDB = async (): Promise<void> => {
await fs.access(dbPath)
await fs.rm(dbPath)
} catch (err: unknown) {
console.error(`No DB exists at path ${dbPath}`)
throw err
throw new Error(`No DB exists at path ${dbPath}`)
}
}

0 comments on commit e7beb54

Please sign in to comment.