Skip to content

Commit

Permalink
Update deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotora committed Aug 26, 2023
1 parent 20814fa commit 5625529
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions deploy.js → deploy.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function uploadDir(src, dest) {
}

async function submit() {
if(!await fs.existsSync('./build')) {
if(!await fs.existsSync(config.localDir)) {
throw Error('Build file not exists, run `yarn build` first.')
}
try{
Expand All @@ -63,10 +63,12 @@ async function submit() {
password: config.password,
// privateKey: fs.readFileSync('./key.pem'),
// passphrase: 'your key passphrase',
// debug: console.log
// debug: console.log,
compress: 'zlib'
});
console.log('Uploading files...')
console.log('Empting remote files...')
await scpClient.emptyDir(config.remoteDir)
console.log('Uploading files...')
scpClient.uploadDir = uploadDir;
await scpClient.uploadDir(config.localDir, config.remoteDir);
await scpClient.close();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"deploy:server": "node deploy.js"
"deploy:server": "node deploy.cjs"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
Expand Down

0 comments on commit 5625529

Please sign in to comment.