Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/phio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import '../dist/cli.js'
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"bugs": {
"url": "https://github.com/pockethost/phio/issues"
},
"main": "src/index.ts",
"module": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.js",
"type": "module",
"types": "src/index.ts",
"types": "dist/index.d.ts",
"devDependencies": {
"@changesets/cli": "^2.28.1",
"@types/bun": "^1.2.3",
Expand All @@ -29,13 +29,17 @@
"prettier-plugin-organize-imports": "^4.1.0"
},
"scripts": {
"dev": "tsx ./src/cli.ts"
"dev": "tsx ./src/cli.ts",
"build": "bun build src/cli.ts src/index.ts --outdir dist --target node --format esm",
"prepare": "bun run build",
"prepack": "bun run build"
},
"bin": {
"phio": "src/cli.ts"
"phio": "bin/phio.js"
},
"files": [
"src"
"dist",
"bin"
],
"dependencies": {
"@inquirer/prompts": "^7.3.2",
Expand Down
7 changes: 5 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env tsx
#!/usr/bin/env node
import { program } from 'commander'
import { version } from '../package.json'
import { createRequire } from 'node:module'
import { DeployCommand } from './commands/DeployCommand'
import { DevCommand } from './commands/DevCommand'
import { InfoCommand } from './commands/InfoCommand'
Expand All @@ -11,6 +11,9 @@ import { LogoutCommand } from './commands/LogoutCommand'
import { LogsCommand } from './commands/LogsCommand'
import { WhoAmICommand } from './commands/WhoAmICommand'

const require = createRequire(import.meta.url)
const { version } = require('../package.json') as { version: string }

program
.name(`PocketHost CLI`)
.version(version)
Expand Down
7 changes: 6 additions & 1 deletion src/commands/DevCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ export async function deployMyCode(
'log-level': verbose ? 'verbose' : 'minimal',
}

await deploy(args)
if (process.platform === 'win32') {
const { deployFixed } = await import('../lib/ftpDeployWindowsPathSafe')
await deployFixed(args)
} else {
await deploy(args)
}
console.log('🚀 Deploy done!')
}

Expand Down
Loading