Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new option excludesFile to parse excludes from .gitignore and such files #46

Merged
merged 1 commit into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"latest-version": "^2.0.0",
"lodash": "^3.10.1",
"minimatch": "^3.0.0",
"parse-gitignore": "^0.3.1",
"prompt": "^0.2.14",
"rsync": "^0.4.0",
"untildify": "^2.1.0",
Expand Down
5 changes: 5 additions & 0 deletions src/local/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
import _ from 'lodash';
import os from 'os';
import untildify from 'untildify';
import gitignore from 'parse-gitignore';
import constants from '../../conf/constants';
import text from '../../conf/text';
import eventsConf from '../../conf/events';
Expand Down Expand Up @@ -47,6 +49,9 @@ function startProject (config, projectConf) {
let destinationLocation = util.ensureTrailingSlash(projectConf.destinationLocation);
let secret = util.getId();

// parse excludesFile
projectConf.excludes = [].concat.apply(projectConf.excludes, projectConf.excludesFile.map(untildify).map(gitignore));

let fsHelper = new FSHelper({
sourceLocation: sourceLocation,
excludes: projectConf.excludes,
Expand Down
5 changes: 5 additions & 0 deletions src/project-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export default {
return csv.split(',');
}
},
excludesFile: {
description: 'Would you like to load excludes from file?',
default: '.gitignore,~/.gitignore',
before: csv => csv.split(','),
},
prefersEncrypted: {
description: 'Would you like to encrypt the sync messages? (yes/no):',
before: util.toBoolean,
Expand Down
1 change: 1 addition & 0 deletions test/local/index.mspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var testConfig = {
myProject: {
project: 'myProject',
excludes: ['.git'],
excludesFile: ['.gitignore'],
sourceLocation: '~/wat',
destinationLocation: '~/wat',
hostname: 'yo-dawg',
Expand Down
2 changes: 2 additions & 0 deletions test/project-helper.mspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Project-Helper', function () {
'sourceLocation',
'destinationLocation',
'excludes',
'excludesFile',
'prefersEncrypted',
'websocketPort',
'followSymLinks',
Expand All @@ -52,6 +53,7 @@ describe('Project-Helper', function () {
'sourceLocation',
'destinationLocation',
'excludes',
'excludesFile',
'prefersEncrypted',
'websocketPort',
'followSymLinks'
Expand Down