Skip to content

Commit 913756b

Browse files
nelakahmelsayed
authored andcommitted
Making cli install relative to node_modules
1 parent 20697c6 commit 913756b

File tree

4 files changed

+3
-19
lines changed

4 files changed

+3
-19
lines changed

src/Azure.Functions.Cli/npm/lib/install.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ var version = require('../package.json').version;
66
var chalk = require('chalk');
77
var path = require('path');
88
var fs = require('fs');
9-
var os = require('os');
109
var rimraf = require('rimraf');
1110
var glob = require('glob');
1211
var execSync = require('child_process').execSync;
1312

1413
function getPath() {
15-
var bin = path.join(os.homedir(), '.azurefunctions', 'bin');
14+
var bin = path.resolve(path.join(path.dirname(__filename), '..', 'bin'));
1615
if (fs.existsSync(bin)) {
1716
rimraf.sync(bin);
1817
}

src/Azure.Functions.Cli/npm/lib/main.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ var fs = require('fs');
55
var spawn = require('child_process').spawn;
66
var fork = require('child_process').fork;
77
var commandExists = require('command-exists');
8-
var os = require('os');
98
var args = process.argv;
109

1110
function main() {
1211
commandExists('dotnet', function (err, commandExists) {
1312
if (commandExists) {
14-
var bin = path.join(os.homedir(), '.azurefunctions', 'bin');
13+
var bin = path.resolve(path.join(path.dirname(__filename), '..', 'bin'));
1514
var funcProc = spawn('dotnet', [bin + '/Azure.Functions.Cli.dll', ].concat(args.slice(2)), {
1615
stdio: [process.stdin, process.stdout, process.stderr, 'pipe']
1716
});

src/Azure.Functions.Cli/npm/lib/uninstall.js

-13
This file was deleted.

src/Azure.Functions.Cli/npm/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"description": "Azure Functions Core Tools",
55
"scripts": {
66
"build": "dotnet publish ../ -o ./npm/bin -c release",
7-
"postinstall": "node lib/install.js",
8-
"uninstall": "node lib/uninstall.js"
7+
"postinstall": "node lib/install.js"
98
},
109
"author": "Microsoft",
1110
"license": "MIT",

0 commit comments

Comments
 (0)