Skip to content

Commit

Permalink
Store all dependencies in this repo (sigh)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyganch committed Feb 4, 2014
1 parent 4e90661 commit 0499066
Show file tree
Hide file tree
Showing 325 changed files with 28,202 additions and 61 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1 +0,0 @@
node_modules/
10 changes: 0 additions & 10 deletions CSScomb JS.sublime-settings
@@ -1,14 +1,4 @@
{
// You must set those two variables to make the plugin work correctly.

// On Unix run from command-line: `echo $PATH`, on Windows: `echo %PATH%`.
// Copy the result here:
"PATH": "/usr/local/bin",

// On Unix run from command-line: `echo $NODE_PATH`, on Windows: `echo
// %NODE_PATH%`. Copy the result here:
"NODE_PATH": "/usr/local/lib/node_modules",

// If you want to use custom config, put file named `.csscomb.json` to the
// project's root or your HOME directory. If for some reason you would like
// to set custom path to configuration file, paste it here.
Expand Down
12 changes: 8 additions & 4 deletions CSScomb.py
Expand Up @@ -64,10 +64,11 @@ def get_config_path(self, config_path=''):
return self.get_config_path(config_path)

def get_env(self):
return {
'PATH': self.get_setting('PATH'),
'NODE_PATH': self.get_setting('NODE_PATH')
}
env = None
if self.is_osx():
env = os.environ.copy()
env['PATH'] += ':/usr/local/bin'
return env

def get_setting(self, key):
settings = self.view.settings().get('CSScomb JS')
Expand All @@ -93,6 +94,9 @@ def has_selection(self):
return True
return False

def is_osx(self):
return platform.system() == 'Darwin'

def is_windows(self):
return platform.system() == 'Windows'

Expand Down
57 changes: 12 additions & 45 deletions csscomb.js
Expand Up @@ -8,52 +8,19 @@ process.stdin.on('data', function (data) {
});

process.stdin.on('end', function () {
var npm;
try {
npm = require('npm');
npm.load({ prefix: __dirname, loglevel: 'error' }, function(err, npm) {
try {
checkAndProcess();
} catch (e) {
installAndProcess();
}
});
} catch (e) {
process.stderr.write('Could not load npm. Please make sure your paths are set correctly in settings.');
var Comb = require('./node_modules/csscomb/lib/csscomb'),
comb = new Comb(),
syntax = process.argv[2],
configPath = process.argv[3],
config, combed;

if (configPath) {
config = require(configPath);
} else {
config = comb.getConfig('csscomb');
}

// Check if installed version is outdated:
function checkAndProcess() {
var installedVersion = require('./node_modules/csscomb/package.json').version,
requiredVersion = require('./package.json').dependencies.csscomb;
if (installedVersion !== requiredVersion) installAndProcess();
else processString();
}

function installAndProcess() {
// Disable install logs:
console.log = function() {};
// Install csscomb package:
npm.commands.install(['csscomb'], function() {
processString();
});
}

function processString() {
var Comb = require('./node_modules/csscomb/lib/csscomb'),
comb = new Comb(),
syntax = process.argv[2],
configPath = process.argv[3],
config, combed;

if (configPath) {
config = require(configPath);
} else {
config = comb.getConfig('csscomb');
}

combed = comb.configure(config).processString(str, syntax);
process.stdout.write(combed);
}
combed = comb.configure(config).processString(str, syntax);
process.stdout.write(combed);
});

1 change: 1 addition & 0 deletions node_modules/.bin/csscomb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions node_modules/csscomb/.jscs.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions node_modules/csscomb/.jshint-groups.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions node_modules/csscomb/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions node_modules/csscomb/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions node_modules/csscomb/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0499066

Please sign in to comment.