Skip to content

Commit

Permalink
fix: plugin-commands-deploy use path resolve on deploy target directo…
Browse files Browse the repository at this point in the history
…ry (pnpm#4980)

Previously the deploy target directory was specified as a relative path
to the workspace project root. This meant that absolute paths could not be used.
Now this uses the current working directory and allows absolute paths,
this is more in line with users expectations of unix command behaivour.

close pnpm#4980
  • Loading branch information
AWare committed Jul 13, 2022
1 parent 701f158 commit 5d57ed9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-foxes-know.md
@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-deploy": major
---

Accept absolute paths and use cwd instead of workspaceDir for deploy target directory.
2 changes: 1 addition & 1 deletion packages/plugin-commands-deploy/src/deploy.ts
Expand Up @@ -45,7 +45,7 @@ export async function handler (
throw new PnpmError('INVALID_DEPLOY_TARGET', 'This command requires one parameter')
}
const deployedDir = selectedDirs[0]
const deployDir = path.join(opts.workspaceDir, params[0])
const deployDir = path.resolve(params[0])
await rimraf(deployDir)
await fs.promises.mkdir(deployDir, { recursive: true })
await copyProject(deployedDir, deployDir)
Expand Down

0 comments on commit 5d57ed9

Please sign in to comment.