1
mirror of https://github.com/cocktailpeanut/dalai synced 2025-02-14 20:14:29 +01:00

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

View File

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