mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-15 12:58:19 +02:00
bin: follow XDG OS conventions for storing data
PR-URL: https://github.com/nodejs/node-gyp/pull/1570 Fixes: https://github.com/nodejs/node-gyp/pull/175 Fixes: https://github.com/nodejs/node-gyp/pull/1124 Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
parent
8098ebdeb4
commit
8a83972743
3 changed files with 4 additions and 3 deletions
|
@ -170,7 +170,7 @@ Some additional resources for addons and writing `gyp` files:
|
|||
| `--thin=yes` | Enable thin static libraries
|
||||
| `--arch=$arch` | Set target architecture (e.g. ia32)
|
||||
| `--tarball=$path` | Get headers from a local tarball
|
||||
| `--devdir=$path` | SDK download directory (default is `~/.node-gyp`)
|
||||
| `--devdir=$path` | SDK download directory (default is OS cache directory)
|
||||
| `--ensure` | Don't reinstall headers if already present
|
||||
| `--dist-url=$url` | Download header tarball from custom URL
|
||||
| `--proxy=$url` | Set HTTP proxy for downloading header tarball
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
process.title = 'node-gyp'
|
||||
|
||||
var envPaths = require('env-paths')
|
||||
var gyp = require('../')
|
||||
var log = require('npmlog')
|
||||
var os = require('os')
|
||||
var path = require('path')
|
||||
|
||||
/**
|
||||
* Process and execute the selected commands.
|
||||
|
@ -20,7 +20,7 @@ var homeDir = os.homedir()
|
|||
if (prog.devDir) {
|
||||
prog.devDir = prog.devDir.replace(/^~/, homeDir)
|
||||
} else if (homeDir) {
|
||||
prog.devDir = path.resolve(homeDir, '.node-gyp')
|
||||
prog.devDir = envPaths('node-gyp', { suffix: '' }).cache
|
||||
} else {
|
||||
throw new Error(
|
||||
"node-gyp requires that the user's home directory is specified " +
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"bin": "./bin/node-gyp.js",
|
||||
"main": "./lib/node-gyp.js",
|
||||
"dependencies": {
|
||||
"env-paths": "^1.0.0",
|
||||
"glob": "^7.0.3",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"mkdirp": "^0.5.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue