phio 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { program } from 'commander'
|
|
|
3
3
|
import { version } from '../package.json'
|
|
4
4
|
import { DeployCommand } from './commands/DeployCommand'
|
|
5
5
|
import { DevCommand } from './commands/DevCommand'
|
|
6
|
+
import { InfoCommand } from './commands/InfoCommand'
|
|
6
7
|
import { LinkCommand } from './commands/LinkCommand'
|
|
7
8
|
import { ListCommand } from './commands/ListCommand'
|
|
8
9
|
import { LoginCommand } from './commands/LoginCommand'
|
|
@@ -20,5 +21,6 @@ program
|
|
|
20
21
|
.addCommand(ListCommand())
|
|
21
22
|
.addCommand(LinkCommand())
|
|
22
23
|
.addCommand(DeployCommand())
|
|
24
|
+
.addCommand(InfoCommand())
|
|
23
25
|
|
|
24
26
|
program.parseAsync(process.argv).catch(console.error)
|
|
@@ -4,7 +4,6 @@ import { IFtpDeployArguments } from '@samkirkland/ftp-deploy/src/types'
|
|
|
4
4
|
import Bottleneck from 'bottleneck'
|
|
5
5
|
import { watch } from 'chokidar'
|
|
6
6
|
import { Command } from 'commander'
|
|
7
|
-
import { ensureDirSync } from 'fs-extra'
|
|
8
7
|
import multimatch from 'multimatch'
|
|
9
8
|
import { config } from '../lib/config'
|
|
10
9
|
import { getInstanceBySubdomainCnameOrId } from '../lib/getClient'
|
|
@@ -93,9 +92,6 @@ export async function deployMyCode(
|
|
|
93
92
|
exclude: string[],
|
|
94
93
|
verbose: boolean
|
|
95
94
|
) {
|
|
96
|
-
const cachePath = '.cache'
|
|
97
|
-
ensureDirSync(cachePath)
|
|
98
|
-
|
|
99
95
|
console.log('🚚 Deploy started')
|
|
100
96
|
const args: IFtpDeployArguments = {
|
|
101
97
|
server: 'ftp.pockethost.io',
|
|
@@ -104,11 +100,9 @@ export async function deployMyCode(
|
|
|
104
100
|
'server-dir': `${instanceName}/`,
|
|
105
101
|
include,
|
|
106
102
|
exclude: [...excludeDefaults, ...exclude],
|
|
107
|
-
'log-level': verbose ? 'verbose' : '
|
|
103
|
+
'log-level': verbose ? 'verbose' : 'minimal',
|
|
108
104
|
}
|
|
109
105
|
|
|
110
|
-
console.log({ args })
|
|
111
|
-
|
|
112
106
|
await deploy(args)
|
|
113
107
|
console.log('🚀 Deploy done!')
|
|
114
108
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import { config } from '../lib/config'
|
|
3
|
+
import { PHIO_HOME } from '../lib/constants'
|
|
4
|
+
|
|
5
|
+
export const InfoCommand = () => {
|
|
6
|
+
return new Command(`info`).description(`Get config info`).action(() => {
|
|
7
|
+
console.log(`Config root: ${PHIO_HOME()}`)
|
|
8
|
+
console.log(`Instance: ${config('instanceId')}`)
|
|
9
|
+
})
|
|
10
|
+
}
|
|
@@ -22,6 +22,14 @@ export const linkWithUserInput = async () => {
|
|
|
22
22
|
const instances = await client
|
|
23
23
|
.collection(`instances`)
|
|
24
24
|
.getFullList<InstanceFields>()
|
|
25
|
+
|
|
26
|
+
if (instances.length === 0) {
|
|
27
|
+
console.error(
|
|
28
|
+
`No instances found. If this seems wrong, use 'phio login' to log in, then try again.`
|
|
29
|
+
)
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
while (true) {
|
|
26
34
|
const instanceNameOrId = await select({
|
|
27
35
|
message: `Choose the instance you'd like to link`,
|