Take environment path separators into account when getting the target dir

This commit is contained in:
Sander Declerck 2025-07-23 11:19:53 +02:00
parent eba1e9cc8e
commit 248bb9f7b6
No known key found for this signature in database

View file

@ -84,10 +84,9 @@ function copyStartupFiles() {
const startupFiles = ["init-posix.sh"];
for (const file of startupFiles) {
const targetDir = path.join(os.homedir(), ".safe-chain", "scripts");
const targetPath = path.join(os.homedir(), ".safe-chain", "scripts", file);
// Create target directory if it doesn't exist
const targetDir = targetPath.substring(0, targetPath.lastIndexOf("/"));
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir, { recursive: true });
}