Skip to content

Commit 9cfd740

Browse files
committed
chore: wip
1 parent 59a57b4 commit 9cfd740

File tree

12 files changed

+60
-81
lines changed

12 files changed

+60
-81
lines changed

.stacks/core/buddy/src/commands/build.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ async function build(buddy: CLI) {
110110
const startTime = await intro('buddy build:core')
111111
const result = await runAction(Action.BuildCore, options)
112112

113-
console.log('result', result)
114-
115-
// if (result.isErr()) {
116-
// log.error('Failed to build the Stacks core.', result.error)
117-
// process.exit()
118-
// }
113+
if (result.isErr()) {
114+
log.error('Failed to build the Stacks core.', result.error as Error)
115+
process.exit()
116+
}
119117

120118
outro('Stacks core built successfully', { startTime, useSeconds: true })
121119
})
@@ -127,12 +125,11 @@ async function build(buddy: CLI) {
127125
.action(async (options: BuildOptions) => {
128126
const startTime = await intro('buddy build:stacks')
129127
const result = await runAction(Action.BuildStacks, options)
130-
console.log('result', result)
131128

132-
// if (result.isErr()) {
133-
// log.error('Failed to build Stacks.', result.error)
134-
// process.exit()
135-
// }
129+
if (result.isErr()) {
130+
log.error('Failed to build Stacks.', result.error as Error)
131+
process.exit()
132+
}
136133

137134
outro('Stacks built successfully', { startTime, useSeconds: true })
138135
})

.stacks/core/buddy/src/commands/changelog.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function changelog(buddy: CLI) {
1515
.action(async (options: FreshOptions) => {
1616
const perf = await intro('buddy changelog')
1717
const result = await runAction(Action.Changelog, options)
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// outro('While running the changelog command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
outro('While running the changelog command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21+
process.exit()
22+
}
2423

2524
outro('Generated the CHANGELOG.md file.', { startTime: perf, useSeconds: true })
2625
process.exit(ExitCode.Success)

.stacks/core/buddy/src/commands/deploy.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function deploy(buddy: CLI) {
1515
.action(async (options: DeployOptions) => {
1616
const perf = await intro('buddy deploy')
1717
const result = await runAction(Action.Deploy, options)
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// outro('While running the `buddy deploy`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
outro('While running the `buddy deploy`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21+
process.exit()
22+
}
2423

2524
outro('Deployment succeeded.', { startTime: perf, useSeconds: true })
2625
process.exit(ExitCode.Success)

.stacks/core/buddy/src/commands/inspire.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ async function inspire(buddy: CLI) {
1010
.action(async () => {
1111
const perf = await intro('buddy inspire')
1212
const result = await runAction(Action.Inspire)
13-
console.log('result', result)
1413

15-
// if (result.isErr()) {
16-
// outro('While running the inspire command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
17-
// process.exit()
18-
// }
14+
if (result.isErr()) {
15+
outro('While running the inspire command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
16+
process.exit()
17+
}
1918

2019
outro('Your quote is: ...', { startTime: perf, useSeconds: true })
2120
process.exit(ExitCode.Success)

.stacks/core/buddy/src/commands/key.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function key(buddy: CLI) {
1515
.action(async (options: KeyOptions) => {
1616
const startTime = await intro('buddy key:generate')
1717
const result = await runAction(Action.KeyGenerate, options)
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// log.error('Failed to set random application key.', result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
log.error('Failed to set random application key.', result.error as Error)
21+
process.exit()
22+
}
2423

2524
outro('Set random application key.', { startTime })
2625
})

.stacks/core/buddy/src/commands/lint.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ async function lint(buddy: CLI) {
1717
.action(async (options: LintOptions) => {
1818
const perf = await intro('buddy lint')
1919
const result = await runAction(Action.Lint, { ...options, showSpinner: true, spinnerText: 'Linting...' })
20-
console.log('result', result)
2120

22-
// if (result.isErr()) {
23-
// outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
24-
// process.exit()
25-
// }
21+
if (result.isErr()) {
22+
outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
23+
process.exit()
24+
}
2625

2726
outro('Linted your project.', { startTime: perf, useSeconds: true })
2827
})
@@ -33,12 +32,11 @@ async function lint(buddy: CLI) {
3332
.action(async (options: LintOptions) => {
3433
log.info('Fixing lint errors...')
3534
const result = await runAction(Action.LintFix, { ...options, showSpinner: true, spinnerText: 'Linting...' })
36-
console.log('result', result)
3735

38-
// if (result.isErr()) {
39-
// log.error('There was an error lint fixing your code.', result.error)
40-
// process.exit()
41-
// }
36+
if (result.isErr()) {
37+
log.error('There was an error lint fixing your code.', result.error as Error)
38+
process.exit()
39+
}
4240

4341
log.success('Fixed lint errors.')
4442
})

.stacks/core/buddy/src/commands/make.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ async function make(buddy: CLI) {
185185
}
186186

187187
const result = await createNotification(options)
188-
console.log('result', result)
189188

190-
// if (!result) {
191-
// outro('While running the make:notification command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
192-
// process.exit()
193-
// }
189+
if (!result) {
190+
outro('While running the make:notification command, there was an issue', { startTime: perf, useSeconds: true, isError: true })
191+
process.exit()
192+
}
194193

195194
outro(`Created your ${italic(name)} notification.`, { startTime: perf, useSeconds: true })
196195
process.exit(ExitCode.Success)

.stacks/core/buddy/src/commands/migrate.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function migrate(buddy: CLI) {
1515
.action(async (options: FreshOptions) => {
1616
const perf = await intro('buddy migrate')
1717
const result = await runAction(Action.Migrate, { ...options, showSpinner: true, spinnerText: 'Migrating...' })
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// outro('While running the migrate command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
outro('While running the migrate command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21+
process.exit()
22+
}
2423

2524
const APP_ENV = process.env.APP_ENV || 'local'
2625

.stacks/core/buddy/src/commands/onboarding.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function onboarding(buddy: CLI) {
1515
.action(async () => {
1616
const startTime = await intro('buddy page:onboarding')
1717
const result = await runAction(Action.GenerateOnboarding)
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// log.error('Something went wrong when generating', result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
log.error('Something went wrong when generating', result.error as Error)
21+
process.exit()
22+
}
2423

2524
outro('Pages generated successfully', { startTime })
2625
})

.stacks/core/buddy/src/commands/setting.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ async function setting(buddy: CLI) {
1515
.action(async () => {
1616
const startTime = await intro('buddy page:setting')
1717
const result = await runAction(Action.GenerateSettings)
18-
console.log('result', result)
1918

20-
// if (result.isErr()) {
21-
// log.error('Something went wrong when generating', result.error)
22-
// process.exit()
23-
// }
19+
if (result.isErr()) {
20+
log.error('Something went wrong when generating', result.error as Error)
21+
process.exit()
22+
}
2423

2524
outro('Pages generated successfully', { startTime })
2625
})

0 commit comments

Comments
 (0)