Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #31 from alexbuijs/fix-ignored-items
Browse files Browse the repository at this point in the history
Fix ignored items. Thanks to @alexbuijs .
  • Loading branch information
nikDemyankov committed May 4, 2016
2 parents 209084a + 9cfb471 commit 13bf5fe
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
fs = require('fs-extra'),
_ = require('lodash'),
ignoreFilePath = path.join(process.cwd(), '.chcpignore'),
DEFAULT_IGNORE_LIST = ['.DS_Store', 'node_modules/*', 'node_modules\\*', 'chcp.json', 'chcp.manifest', '.chcp*', '.gitignore', '.git', 'package.json'];
DEFAULT_IGNORE_LIST = ['.DS_Store', 'node_modules/*', 'node_modules\\*', 'chcp.json', 'chcp.manifest', '.chcp*', '.gitignore', '.gitkeep', '.git', 'package.json'];

module.exports = {
context: context
Expand Down Expand Up @@ -46,7 +46,7 @@
}

if (projectIgnore.length > 0) {
_.assign(this.__ignoredFiles, _.trim(projectIgnore).split(/\n/));
this.__ignoredFiles = this.__ignoredFiles.concat(_.trim(projectIgnore).split(/\n/));
}

return this.__ignoredFiles;
Expand Down
14 changes: 12 additions & 2 deletions dist/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
function deploy(context) {
var executeDfd = Q.defer(),
config,
credentials;
credentials,
ignore = context.ignoredFiles();

try {
config = fs.readFileSync(context.defaultConfig, 'utf-8');
Expand All @@ -55,11 +56,20 @@
process.exit(0);
}

ignore = ignore.filter(function (ignoredFile) {
return !ignoredFile.match(/^chcp/);
});
ignore = ignore.map(function (ignoredFile) {
return '!' + ignoredFile;
});

// console.log('Credentials: ', credentials);
// console.log('Config: ', config);
// console.log('Ignore: ', ignore);

var files = readdirp({
root: context.sourceDirectory
root: context.sourceDirectory,
fileFilter: ignore
});

var uploader = s3sync({
Expand Down
3 changes: 2 additions & 1 deletion src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'chcp.manifest',
'.chcp*',
'.gitignore',
'.gitkeep',
'.git',
'package.json'
];
Expand Down Expand Up @@ -54,7 +55,7 @@
}

if (projectIgnore.length > 0) {
_.assign(this.__ignoredFiles, _.trim(projectIgnore).split(/\n/));
this.__ignoredFiles = this.__ignoredFiles.concat(_.trim(projectIgnore).split(/\n/));
}

return this.__ignoredFiles;
Expand Down
10 changes: 8 additions & 2 deletions src/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
function deploy(context) {
var executeDfd = Q.defer(),
config,
credentials;
credentials,
ignore = context.ignoredFiles();

try {
config = fs.readFileSync(context.defaultConfig, 'utf-8');
Expand All @@ -53,11 +54,16 @@
process.exit(0);
}

ignore = ignore.filter( ignoredFile => !ignoredFile.match(/^chcp/) )
ignore = ignore.map( ignoredFile => `!${ignoredFile}` )

// console.log('Credentials: ', credentials);
// console.log('Config: ', config);
// console.log('Ignore: ', ignore);

var files = readdirp({
root: context.sourceDirectory
root: context.sourceDirectory,
fileFilter: ignore
});

var uploader = s3sync({
Expand Down

0 comments on commit 13bf5fe

Please sign in to comment.