Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
only allow relative paths to config files, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickocoffeyo committed Nov 25, 2015
1 parent 0df02fa commit eb3bfd0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ _in your `aquifer.json` file:_
"extensions": {
"aquifer-coder": {
"source": "aquifer-coder",
"eslintrc": "/path/to/eslintrc",
"phpcsStandard": "/path/to/phpcsStandardFile"
"eslintrc": "relative/path/to/.eslintrc",
"eslintIgnore": "relative/path/to/.eslintignore"
"phpcsStandard": "relative/path/to/phpcsStandardFile"
}
}
...
Expand Down
12 changes: 12 additions & 0 deletions aquifer-coder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,25 @@ module.exports = function(Aquifer, AquiferCoderConfig) {
fs = require('fs-extra'),
syncExec = require('sync-exec');

// Turn any passed-in paths into full paths.
if (AquiferCoderConfig.hasOwnProperty('eslintrc')) {
AquiferCoderConfig.eslintrc = path.join(Aquifer.projectDir, AquiferCoderConfig.eslintrc);
}
if (AquiferCoderConfig.hasOwnProperty('eslintIgnore')) {
AquiferCoderConfig.eslintIgnore = path.join(Aquifer.projectDir, AquiferCoderConfig.eslintIgnore);
}
if (AquiferCoderConfig.hasOwnProperty('phpcsStandard')) {
AquiferCoderConfig.phpcsStandard = path.join(Aquifer.projectDir, AquiferCoderConfig.phpcsStandard);
}

// Create defauts for options.
_.defaults(AquiferCoderConfig, {
eslintrc: path.join(__dirname, 'src', '.eslintrc'),
eslintIgnore: path.join(__dirname, 'src', '.eslintignore'),
phpcsStandard: path.join(__dirname, '/vendor/drupalmodule/coder/coder_sniffer/Drupal')
});


/**
* Creates a commands that are exported to Aquifer command.
* @returns {object} commands to be added to Aquifer.
Expand Down

0 comments on commit eb3bfd0

Please sign in to comment.