mirror of
https://github.com/ershisan99/go-npm.git
synced 2025-12-16 20:59:28 +00:00
fix unlink
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@ershisan99/go-npm",
|
"name": "@ershisan99/go-npm",
|
||||||
"version": "0.1.13",
|
"version": "0.1.14",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@ershisan99/go-npm",
|
"name": "@ershisan99/go-npm",
|
||||||
"version": "0.1.13",
|
"version": "0.1.14",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"go-npm": "bin/index.js"
|
"go-npm": "bin/index.js"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ershisan99/go-npm",
|
"name": "@ershisan99/go-npm",
|
||||||
"version": "0.1.13",
|
"version": "0.1.14",
|
||||||
"description": "Distribute and install Go binaries via NPM",
|
"description": "Distribute and install Go binaries via NPM",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const { chmodSync, copyFileSync, existsSync, unlink } = require('fs');
|
const { chmodSync, copyFileSync, existsSync, unlinkSync } = require('fs');
|
||||||
const { getInstallationPath } = require('../common');
|
const { getInstallationPath } = require('../common');
|
||||||
|
|
||||||
function verifyAndPlaceBinary(binName, binPath, callback) {
|
function verifyAndPlaceBinary(binName, binPath, callback) {
|
||||||
@@ -14,7 +14,7 @@ function verifyAndPlaceBinary(binName, binPath, callback) {
|
|||||||
|
|
||||||
// Move the binary file and make sure it is executable
|
// Move the binary file and make sure it is executable
|
||||||
copyFileSync(join(binPath, binName), join(installationPath, binName));
|
copyFileSync(join(binPath, binName), join(installationPath, binName));
|
||||||
unlink(join(binPath, binName));
|
unlinkSync(join(binPath, binName));
|
||||||
chmodSync(join(installationPath, binName), '755');
|
chmodSync(join(installationPath, binName), '755');
|
||||||
|
|
||||||
console.log('Placed binary on', join(installationPath, binName));
|
console.log('Placed binary on', join(installationPath, binName));
|
||||||
|
|||||||
Reference in New Issue
Block a user