-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathNpm.fsx
More file actions
30 lines (23 loc) · 821 Bytes
/
Npm.fsx
File metadata and controls
30 lines (23 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#r @"../../../packages/FAKE/tools/FakeLib.dll"
#load "./Utils.fsx"
open Fake
open Utils
open System
open System.IO
let nodeDir64 = "C:\\Program Files\\nodejs\\"
let nodeDir86 = "C:\\Program Files (x86)\\nodejs\\"
let nodeDir = match Directory.Exists nodeDir64 with | true -> nodeDir64 | _ -> nodeDir86
let node = Path.Combine(nodeDir, "node.exe")
let npm = Path.Combine(nodeDir, "npm.cmd")
let install (config : Map<string, string>) _ =
let args = "install"
let workingdir =
match config.TryFind "npm:dir" with
| Some x when String.IsNullOrEmpty x = false -> x
| _ -> ".\\build"
let result =
ExecProcess (fun info ->
info.FileName <- npm
info.WorkingDirectory <- workingdir
info.Arguments <- args) (TimeSpan.FromMinutes 5.)
()