Skip to content

Commit

Permalink
Merge pull request #64 from Hexagon/dev
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
Hexagon authored Nov 14, 2024
2 parents f65acd2 + 7d74c6d commit 6268ffd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/cli/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function appendConfigurationFile(configFile: string, checkedArgs: A
const existingConfigurationText = new TextDecoder().decode(existingConfiguration)
existingConfigurationObject = JSON5.parse(existingConfigurationText) as unknown as Configuration
} catch (e) {
throw new Error("Could not read configuration file: " + e.message)
throw new Error("Could not read configuration file: " + (e instanceof Error ? e.message : "Unknown"))
}

// Check for valid parse
Expand Down Expand Up @@ -96,8 +96,8 @@ export async function appendConfigurationFile(configFile: string, checkedArgs: A
// Append new process, and write configuration file
existingConfigurationObject.processes.push(newConfiguration.processes[0])
await writeFile(configFile, JSON.stringify(existingConfigurationObject, null, 2))
} catch (e) {
console.error(`Could not modify configuration file '${configFile}': `, e.message)
} catch (_e) {
console.error(`Could not modify configuration file '${configFile}'`)
exit(1)
}
}
Expand All @@ -115,8 +115,8 @@ export async function removeFromConfigurationFile(configFile: string, checkedArg
const existingConfiguration = await readFile(configFile)
const existingConfigurationText = new TextDecoder().decode(existingConfiguration)
existingConfigurationObject = JSON5.parse(existingConfigurationText) as unknown as Configuration
} catch (e) {
throw new Error("Could not read configuration file.", e.message)
} catch (_e) {
throw new Error("Could not read configuration file.")
}

if (!existingConfigurationObject) {
Expand All @@ -135,7 +135,7 @@ export async function removeFromConfigurationFile(configFile: string, checkedArg
// Append new process, and write configuration file
await writeFile(configFile, JSON.stringify(existingConfigurationObject, null, 2))
} catch (e) {
console.error(`Could not modify configuration file ${configFile}: `, e.message)
console.error(`Could not modify configuration file ${configFile}: `, e instanceof Error ? e.message : "Unknown")
exit(1)
}
}
Expand Down

0 comments on commit 6268ffd

Please sign in to comment.