-
Notifications
You must be signed in to change notification settings - Fork 656
Reorganize gulpfiles & gulp tasks #217
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
35102c6
handle new lines in templates
Swiip 683b45a
little refacto for js preprocessor files detection
Swiip 3381a3b
use template upgrade for index.html
Swiip 0413651
big reorganizations of gulp tasks
Swiip 283297a
switch to only one html preprocessor
Swiip 41fae80
adapt test files generate to new gulp tasks
Swiip 7dd2e6d
merge with --advanced feature
Swiip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,54 @@ | ||
| 'use strict'; | ||
|
|
||
| var utils = require('./utils'); | ||
| var files = require('../files.json'); | ||
|
|
||
| /* Process files */ | ||
| module.exports = function () { | ||
| var _ = this._; | ||
| var data = this; | ||
|
|
||
| function process(content) { | ||
| return _.template(content.toString().replace(/\n<%/g, '<%'), data); | ||
| } | ||
|
|
||
| var copy = function copy(src, dest, processing) { | ||
| dest = utils.replacePrefix(dest, this.props.paths); | ||
| try { | ||
| if(processing) { | ||
| this.fs.copy(this.templatePath(src), this.destinationPath(dest), { process: process }); | ||
| } else { | ||
| this.fs.copy(this.templatePath(src), this.destinationPath(dest)); | ||
| } | ||
| } catch (error) { | ||
| console.error('Template processing error on file', src); | ||
| throw error; | ||
| } | ||
| }.bind(this); | ||
|
|
||
| // Copy dot files | ||
| _.forEach(files.dotFiles, function(src) { | ||
| copy(src, '.' + src); | ||
| }); | ||
|
|
||
| // Copy files formatted (format.js) with options selected in prompt | ||
| _.forEach(this.staticFiles, function(value, key) { | ||
| var dest = utils.replacePrefix(value, this.props.paths); | ||
| this.fs.copy(this.templatePath(key), this.destinationPath(dest)); | ||
| }.bind(this)); | ||
| _.forEach(this.staticFiles, function(dest, src) { | ||
| copy(src, dest); | ||
| }); | ||
|
|
||
| _.forEach(this.technologiesLogoCopies, function(src) { | ||
| var dest = utils.replacePrefix(src, this.props.paths); | ||
| this.fs.copy(this.templatePath(src), this.destinationPath(dest)); | ||
| }.bind(this)); | ||
| _.forEach(this.partialCopies, function(value, key) { | ||
| var dest = utils.replacePrefix(value, this.props.paths); | ||
| this.fs.copy(this.templatePath(key), this.destinationPath(dest)); | ||
| }.bind(this)); | ||
| _.forEach(this.styleCopies, function(value, key) { | ||
| var dest = utils.replacePrefix(value, this.props.paths); | ||
| this.fs.copy(this.templatePath(key), this.destinationPath(dest)); | ||
| }.bind(this)); | ||
| _.forEach(this.srcTemplates, function(value, key) { | ||
| var dest = utils.replacePrefix(value, this.props.paths); | ||
| this.template(key, dest); | ||
| }.bind(this)); | ||
| copy(src, src); | ||
| }); | ||
| _.forEach(this.partialCopies, function(dest, src) { | ||
| copy(src, dest); | ||
| }); | ||
| _.forEach(this.styleCopies, function(dest, src) { | ||
| copy(src, dest, true); | ||
| }); | ||
| _.forEach(this.srcTemplates, function(dest, src) { | ||
| copy(src, dest, true); | ||
| }); | ||
| _.forEach(this.lintConfCopies, function(src) { | ||
| this.fs.copy(this.templatePath(src), this.destinationPath(src)); | ||
| }.bind(this)); | ||
| copy(src, src); | ||
| }); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
dotfilesis gone so this can be removed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right but I think I'll keep this waiting for a further refactoring PR...
This one is too big already