Skip to content

Commit

Permalink
fix: fix init-countries
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Jun 7, 2024
1 parent 055136b commit 1f83d88
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/init-countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ async function main () {
try {
countries = await getCountries()
} catch (error) {
console.log(error)
console.log('--- No Countries were found, a restart is suggested ---')
process.exit(0)
process.exit(-3)
}

let cities = []
try {
cities = await getCities()
} catch (error) {
console.log(error)
console.log('--- No Cities were found, a restart is suggested ---')
process.exit(0)
process.exit(-2)
}

const pool = new Pool(config)
Expand Down Expand Up @@ -102,12 +104,12 @@ async function main () {
.then(res => {
console.log(res)
})
.catch(err => console.log(err))
.catch(err => { console.log(err); process.exit(1)})
.then(process.exit(0))

} catch (error) {
console.log(error)
process.exit(0)
process.exit(2)
}
}

Expand Down

0 comments on commit 1f83d88

Please sign in to comment.