From 40c5e5abb4b67fc703f1c9267c44332681599b59 Mon Sep 17 00:00:00 2001 From: andres Date: Mon, 11 Dec 2023 13:51:21 +0100 Subject: [PATCH] fix unlink --- package-lock.json | 4 ++-- package.json | 2 +- src/assets/binary.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37d5bc6..ed32c7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ershisan99/go-npm", - "version": "0.1.13", + "version": "0.1.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ershisan99/go-npm", - "version": "0.1.13", + "version": "0.1.14", "license": "Apache-2.0", "bin": { "go-npm": "bin/index.js" diff --git a/package.json b/package.json index db75548..875b435 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ershisan99/go-npm", - "version": "0.1.13", + "version": "0.1.14", "description": "Distribute and install Go binaries via NPM", "main": "index.js", "bin": { diff --git a/src/assets/binary.js b/src/assets/binary.js index fc0ac2d..e0f8dd3 100644 --- a/src/assets/binary.js +++ b/src/assets/binary.js @@ -1,5 +1,5 @@ const { join } = require('path'); -const { chmodSync, copyFileSync, existsSync, unlink } = require('fs'); +const { chmodSync, copyFileSync, existsSync, unlinkSync } = require('fs'); const { getInstallationPath } = require('../common'); function verifyAndPlaceBinary(binName, binPath, callback) { @@ -14,7 +14,7 @@ function verifyAndPlaceBinary(binName, binPath, callback) { // Move the binary file and make sure it is executable copyFileSync(join(binPath, binName), join(installationPath, binName)); - unlink(join(binPath, binName)); + unlinkSync(join(binPath, binName)); chmodSync(join(installationPath, binName), '755'); console.log('Placed binary on', join(installationPath, binName));