setup postinstall script fix

The path `node ./bin/cli setup` isn't working on some operating systems such as windows, because the forward slash is not recognized.

Just create a setup.js file in the root path and call it without any path issues.
This commit is contained in:
cocktailpeanut 2023-03-17 16:56:47 -04:00
parent 6c18f02431
commit bc49b5ac0f
3 changed files with 16 additions and 4 deletions

8
package-lock.json generated
View File

@ -1,12 +1,13 @@
{
"name": "dalai",
"version": "0.2.9",
"version": "0.2.21",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "dalai",
"version": "0.2.9",
"version": "0.2.21",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"7zip-min": "^1.4.4",
@ -27,6 +28,9 @@
},
"devDependencies": {
"prettier": "^2.8.4"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@cronvel/get-pixels": {

View File

@ -1,6 +1,6 @@
{
"name": "dalai",
"version": "0.2.20",
"version": "0.2.21",
"description": "",
"main": "index.js",
"author": "cocktailpeanut",
@ -13,7 +13,7 @@
"start": "./dalai serve",
"just:run": "wrap () { yarn && yarn dalai:llama $1 && yarn start; }; wrap",
"just:fix": "npx prettier --write .",
"postinstall": "node ./bin/cli setup"
"postinstall": "node setup"
},
"dependencies": {
"7zip-min": "^1.4.4",

8
setup.js Normal file
View File

@ -0,0 +1,8 @@
const Dalai = require("./index")
new Dalai().setup().then(() => {
console.log("executed setup")
process.exit(0)
}).catch((e) => {
console.log("Error", e)
process.exit(1)
})