1
- /* eslint-disable no-console */
2
1
import process from 'node:process'
3
2
import type { CLI , DeployOptions } from '@stacksjs/types'
4
3
import { runAction } from '@stacksjs/actions'
5
- import { intro , italic , outro } from '@stacksjs/cli'
4
+ import { intro , italic , log , outro } from '@stacksjs/cli'
6
5
import { Action , ExitCode } from '@stacksjs/types'
7
6
import { Route53 } from '@aws-sdk/client-route-53'
8
7
import { app } from '@stacksjs/config'
@@ -22,22 +21,22 @@ export function deploy(buddy: CLI) {
22
21
const domain = options . domain || app . url
23
22
24
23
if ( ! domain ) {
25
- console . log ( 'We could not identify a domain to deploy to.' )
26
- console . log ( 'Please set your .env or ./config/app.ts properly.' )
27
- console . log ( '' )
28
- console . log ( 'ℹ️ Alternatively, specify a domain to deploy via the `--domain` flag.' )
29
- console . log ( '' )
30
- console . log ( ' ➡️ Example: `buddy deploy --domain example.com`' )
31
- console . log ( '' )
24
+ log . info ( 'We could not identify a domain to deploy to.' )
25
+ log . info ( 'Please set your .env or ./config/app.ts properly.' )
26
+ log . info ( '' )
27
+ log . info ( 'ℹ️ Alternatively, specify a domain to deploy via the `--domain` flag.' )
28
+ log . info ( '' )
29
+ log . info ( ' ➡️ Example: `buddy deploy --domain example.com`' )
30
+ log . info ( '' )
32
31
process . exit ( ExitCode . FatalError )
33
32
}
34
33
35
34
if ( await hasUserDomainBeenAddedToCloud ( domain ) ) {
36
35
log . info ( '' )
37
36
log . info ( '✅ Your domain is properly configured.' )
38
- log . info ( 'ℹ️ Your application is deploying.. .' )
37
+ log . info ( 'ℹ️ Your cloud is deploying.' )
39
38
log . info ( '' )
40
- log . info ( italic ( 'This may take a while to complete .' ) )
39
+ log . info ( italic ( '⏳ This may take a while.. .' ) )
41
40
log . info ( '' )
42
41
await new Promise ( resolve => setTimeout ( resolve , 2000 ) )
43
42
options . domain = domain
@@ -46,12 +45,12 @@ export function deploy(buddy: CLI) {
46
45
// if the domain hasn't been added to the user's (AWS) cloud, we will add it for them
47
46
// and then exit the process with prompts for the user to update their nameservers
48
47
else {
49
- console . log ( '' )
50
- console . log ( `👋 It appears to be your first ${ italic ( domain ) } deployment.` )
51
- console . log ( '' )
52
- console . log ( italic ( 'Let’s ensure it is all connected properly.' ) )
53
- console . log ( italic ( 'One moment...' ) )
54
- console . log ( '' )
48
+ log . info ( '' )
49
+ log . info ( `👋 It appears to be your first ${ italic ( domain ) } deployment.` )
50
+ log . info ( '' )
51
+ log . info ( italic ( 'Let’s ensure it is all connected properly.' ) )
52
+ log . info ( italic ( 'One moment...' ) )
53
+ log . info ( '' )
55
54
56
55
options . domain = domain
57
56
await addDomain ( options , perf )
@@ -72,7 +71,7 @@ export function deploy(buddy: CLI) {
72
71
} )
73
72
74
73
buddy . on ( 'deploy:*' , ( ) => {
75
- console . error ( 'Invalid command: %s\nSee --help for a list of available commands.' , buddy . args . join ( ' ' ) )
74
+ log . error ( 'Invalid command: %s\nSee --help for a list of available commands.' , buddy . args . join ( ' ' ) )
76
75
process . exit ( 1 )
77
76
} )
78
77
}
0 commit comments