Skip to content

Commit

Permalink
node package
Browse files Browse the repository at this point in the history
  • Loading branch information
imzlh committed Sep 30, 2024
1 parent 372449a commit cd907fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g typescript
- run: git clone https://github.com/nginx/njs.git && mv njs/ts/ type
- run: tsc --target ES2022 --lib ES2022 main.ts
- run: npm install
- run: npm run clone-type
- run: npm run build
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ async function main(h:NginxHTTPRequest){

const from = APP_ROOT + '/' + format(request.from[i], false);

await move(from, to + '/' + request.from[i].split('/').pop(), to_stat.dev);
await move(from, to + '/' + from.split('/').pop(), to_stat.dev);
}catch(e){
return _error(e, 'Move');
}
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "vlist-ngx-api",
"version": "5.7",
"private": true,
"type": "module",
"scripts": {
"build": "tsc --target ES2022 --lib ES2022 main.ts",
"clone-type": "git clone https://github.com/nginx/njs.git && mv njs/ts/ type"
},
"dependencies": {
"typescript": "~5.4.0"
}
}

0 comments on commit cd907fb

Please sign in to comment.