Skip to content

Commit

Permalink
Update install again
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Feb 5, 2015
1 parent ac50bec commit 86f8631
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion semantic.json.example
Expand Up @@ -17,7 +17,7 @@
"clean" : "dist/"
},

"permission" : 644,
"permission" : false,
"rtl": false

}
2 changes: 1 addition & 1 deletion tasks/config/project/install.js
Expand Up @@ -215,7 +215,7 @@ module.exports = {
config : './',
definitions : 'src/definitions/',
modules : 'node_modules/',
site : 'src/site',
site : 'src/site/',
tasks : 'tasks/',
themeConfig : 'src/',
themes : 'src/themes/'
Expand Down
37 changes: 23 additions & 14 deletions tasks/install.js
Expand Up @@ -80,12 +80,13 @@ module.exports = function () {
var
updateFolder = manager.root,
updatePaths = {
config : path.join(updateFolder, files.config),
modules : path.join(updateFolder, currentConfig.base, folders.modules),
tasks : path.join(updateFolder, currentConfig.base, folders.tasks),
definition : path.join(updateFolder, currentConfig.paths.source.definitions),
site : path.join(updateFolder, currentConfig.paths.source.site),
theme : path.join(updateFolder, currentConfig.paths.source.themes)
config : path.join(updateFolder, files.config),
modules : path.join(updateFolder, currentConfig.base, folders.modules),
tasks : path.join(updateFolder, currentConfig.base, folders.tasks),
definition : path.join(updateFolder, currentConfig.paths.source.definitions),
site : path.join(updateFolder, currentConfig.paths.source.site),
themeImport : path.join(updateFolder, source.themeImport),
theme : path.join(updateFolder, currentConfig.paths.source.themes)
}
;

Expand Down Expand Up @@ -201,10 +202,11 @@ module.exports = function () {

// special install paths only for PM install
installPaths = extend(false, {}, installPaths, {
definition : folders.definitions,
theme : folders.themes,
modules : folders.modules,
tasks : folders.tasks
definition : folders.definitions,
theme : folders.themes,
modules : folders.modules,
tasks : folders.tasks,
themeImport : folders.themeImport
});

// add project root to semantic root
Expand Down Expand Up @@ -246,6 +248,13 @@ module.exports = function () {
wrench.copyDirSyncRecursive(source.modules, installPaths.modules, settings.wrench.install);
wrench.copyDirSyncRecursive(source.tasks, installPaths.tasks, settings.wrench.install);

// copy theme import
console.info('Adding theme import file');
gulp.src(source.themeImport)
.pipe(plumber())
.pipe(gulp.dest(installPaths.themeImport))
;

// create gulp file
console.info('Creating gulp-file.js');
gulp.src(source.userGulpFile)
Expand Down Expand Up @@ -288,15 +297,15 @@ module.exports = function () {
console.info('Adjusting @siteFolder', siteVariable);

if(fs.existsSync(installPaths.themeConfig)) {
console.info('Modifying src/theme.config (LESS config)');
console.info('Modifying src/theme.config (LESS config)', installPaths.themeConfig);
gulp.src(installPaths.themeConfig)
.pipe(plumber())
.pipe(replace(regExp.siteVariable, siteVariable))
.pipe(gulp.dest(installPaths.themeConfigFolder))
;
}
else {
console.info('Creating src/theme.config (LESS config)');
console.info('Creating src/theme.config (LESS config)', installPaths.themeConfig);
gulp.src(source.themeConfig)
.pipe(plumber())
.pipe(rename({ extname : '' }))
Expand All @@ -315,7 +324,7 @@ module.exports = function () {

// adjust variables in theme.less
if( fs.existsSync(files.config) ) {
console.info('Extending config file (semantic.json)');
console.info('Extending config file (semantic.json)', installPaths.config);
gulp.src(installPaths.config)
.pipe(plumber())
.pipe(rename(settings.rename.json)) // preserve file extension
Expand All @@ -324,7 +333,7 @@ module.exports = function () {
;
}
else {
console.info('Creating config file (semantic.json)');
console.info('Creating config file (semantic.json)', installPaths.config);
gulp.src(source.config)
.pipe(plumber())
.pipe(rename({ extname : '' })) // remove .template from ext
Expand Down

0 comments on commit 86f8631

Please sign in to comment.