Skip to content

Commit

Permalink
switch to post install
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Oct 24, 2024
1 parent 2648929 commit 3f8ef4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"sign": "node debug/sign.js",
"start": "node ./scripts/launchdev.js",
"typescript": "yarn run tsc",
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.js",
"postinstall": "node ./scripts/todesktop/beforeInstall.js",
"todesktop:afterPack": "./scripts/todesktop/afterPack.js"
},
"devDependencies": {
Expand Down
10 changes: 7 additions & 3 deletions scripts/todesktop/beforeInstall.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const { exec, execSync } = require("child_process");
const path = require("path");
const os = require('os');
const process = require("process");

module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => {
async function postInstall() {
/**
* pkgJsonPath - string - path to the package.json file
* pkgJson - object - the parsed package.json file
Expand All @@ -18,7 +19,8 @@ module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => {
}
};

const dirPath = pkgJsonPath.replace("package.json", "");
const dirPath = process.cwd();
console.log(dirPath);

console.log(os.platform());

Expand All @@ -44,4 +46,6 @@ module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => {
const result = execSync(`sh ${path.join(dirPath, 'scripts', 'signPython.sh')}`, execOutput).toString();
console.log("finish python");
}
};
};

postInstall();

0 comments on commit 3f8ef4e

Please sign in to comment.