clang-tools-prebuilt
Advanced tools
Comparing version 0.1.0 to 0.1.1
const path = require('path') | ||
module.exports = path.join(__dirname, 'prebuilt_binaries', 'bin') | ||
module.exports = path.join(__dirname, 'dist', 'bin') |
const download = require('./download.js') | ||
const revision = require('./package').clang_revision | ||
const exec = require('child_process').exec | ||
const fs = require('fs') | ||
const path = require('path') | ||
const mkdirp = require('mkdirp') | ||
const exec = require('child_process').exec | ||
const os = require('os') | ||
const dest = path.join(__dirname, './dist/') | ||
const dest = path.join(__dirname, './prebuilt_binaries/') | ||
var installed_revision = null | ||
try { | ||
installed_revision = fs.readFileSync(path.join(__dirname, 'dist', 'cr_build_revision'), 'utf-8').replace(/(\n|\r)+$/, '') | ||
} catch (err) { | ||
// do nothing | ||
} | ||
const platform = os.platform() | ||
const platforms = { | ||
darwin: 'mac', | ||
linux: 'linux', | ||
freebsd: 'linux' | ||
} | ||
if (!platforms[platform]) throw new Error('Unknown platform: ' + platform) | ||
if (installed_revision === revision) { | ||
process.exit(0) | ||
} | ||
download({ | ||
'revision': '274142', | ||
'platform': 'mac' | ||
'revision': revision, | ||
'platform': platforms[platform] | ||
}, (err, file_path) => { | ||
@@ -12,0 +34,0 @@ mkdirp(dest, (error) => { |
{ | ||
"name": "clang-tools-prebuilt", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"clang_revision": "274369", | ||
"description": "Install clang tools prebuilt binaries for the command-line use using npm", | ||
"bin": { | ||
"clang-apply-replacements": "tools/clang-apply-replacements.js", | ||
"clang-tidy": "tools/clang-tidy.js", | ||
"clang-rename": "tools/clang-rename.js", | ||
"clang-include-fixer": "tools/clang-include-fixer.js", | ||
@@ -12,4 +15,6 @@ "find-all-symbols": "tools/find-all-symbols.js" | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"postinstall": "node install.js" | ||
"cache-clean": "rm -rf ~/.clang-tools && rm -rf dist", | ||
"postinstall": "node install.js", | ||
"pretest": "npm run cache-clean && node install.js", | ||
"test": "tape test/*.js" | ||
}, | ||
@@ -34,3 +39,6 @@ "repository": { | ||
}, | ||
"devDependencies": { | ||
"tape": "^3.0.2" | ||
}, | ||
"homepage": "https://github.com/hokein/clang-tools-prebuilt" | ||
} |
# clang-tools-prebuilt | ||
[![Build Status](https://travis-ci.org/hokein/clang-tools-prebuilt.svg?branch=master)](https://travis-ci.org/hokein/clang-tools-prebuilt) | ||
[![NPM](https://nodei.co/npm/clang-tools-prebuilt.png?downloads=true)](https://nodei.co/npm/clang-tools-prebuilt/) | ||
Install clang tools prebuilt binaries for command-line usage via npm. The module | ||
helps you easily install clang tools command for use without compile anything. | ||
Currently, the module provides clang tools in [clang-tool-extra](http://clang.llvm.org/extra/): | ||
* clang-tidy | ||
* clang-include-fixer | ||
* find-all-symbol | ||
Currently, the module provides clang tools in [clang-tools-extra](http://clang.llvm.org/extra/): | ||
* clang-apply-replacements | ||
* clang-rename | ||
* [clang-tidy](http://clang.llvm.org/extra/clang-tidy/index.html) | ||
* [clang-include-fixer](http://clang.llvm.org/extra/include-fixer.html) | ||
* find-all-symbols | ||
@@ -22,3 +28,5 @@ ## Installation | ||
``` | ||
clang-apply-replacements ... | ||
clang-tidy ... | ||
clang-rename ... | ||
clang-include-fixer ... | ||
@@ -25,0 +33,0 @@ find-all-symbols ... |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
5608
14
103
1
38
1
2