Commit 0f8ebf6d authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] allow sgc-config to be stored in project root

parent 71d42cf0
SGC_VERSION=1.0.2
SGC_VERSION=1.1.0
......@@ -2,7 +2,8 @@
var gulp = require('gulp'),
argv = require('yargs').argv,
config = require('./config.json'),
settings = require('./settings'),
config = settings.getConfig(),
plugins = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'browser-sync']
});
......
......@@ -3,7 +3,7 @@
var gulp = require('gulp'),
path = require('path'),
settings = require('./settings'),
config = require('./config.json'),
config = settings.getConfig(),
argv = require('yargs').argv,
plugins = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'browser-sync']
......
'use strict';
var gulp = require('gulp'),
config = require('./config.json'),
settings = require('./settings'),
config = settings.getConfig(),
path = require('path'),
plugins = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'browserify', 'browser-sync', 'merge-stream']
......
'use strict';
var gulp = require('gulp'),
config = require('./config.json'),
settings = require('./settings'),
config = settings.getConfig(),
path = require('path'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
......
'use strict';
var config = require('./config.json'),
extensionPath = config.directories.basePath,
webPath = config.directories.webPath,
var config,
fs = require('fs'),
settings = {},
extensionPath,
webPath,
path = require('path'),
extension = config.extensions[0],
extension,
argv = require('yargs').argv;
module.exports.getPath = function(isWebPath) {
function init() {
config = settings.getConfig();
extensionPath = config.directories.basePath;
webPath = config.directories.webPath;
extension = config.extensions[0];
}
settings.getPath = function(isWebPath) {
var extensionName = (typeof argv.ext !== 'undefined') ? argv.ext : extension;
return typeof isWebPath !== "undefined" ? path.join(webPath, extensionName) : path.join(extensionPath, extensionName);
};
module.exports.setPath = function(extensionName) {
settings.setPath = function(extensionName) {
extension = extensionName;
};
settings.getConfig = function() {
try {
fs.statSync('./sgc-core/gulp/config.json');
return require('./config.json');
} catch(exception) {
return require('../../.sgc-config.json');
}
};
init();
module.exports = settings;
{
"directories": {
"basePath": "typo3conf/ext/",
"webPath": "typo3conf/ext/",
"basePath": "web/typo3conf/ext/",
"webPath": "web/typo3conf/ext/",
"css": "Resources/Public/StyleSheets",
"sass": "Resources/Public/Sass",
"javascriptSrc": "Resources/Public/JavaScript",
......@@ -11,12 +11,12 @@
"svg": "Resources/Public/Images/Svg"
},
"abovethefold": {
"template": "typo3conf/ext/project_theme/Resources/Private/Templates/Abovethefold/Src/PageRenderTemplate.html",
"dest": "typo3conf/ext/project_theme/Resources/Private/Templates/Abovethefold/Dist/"
"template": "web/typo3conf/ext/project_theme/Resources/Private/Templates/Abovethefold/Src/PageRenderTemplate.html",
"dest": "web/typo3conf/ext/project_theme/Resources/Private/Templates/Abovethefold/Dist/"
},
"js": {
"libraryPaths": [
"./typo3conf/ext/project_theme/node_modules"
"./web/typo3conf/ext/project_theme/node_modules"
],
"excludeFromQa": [
"!**/Extensions/**/*"
......@@ -24,8 +24,8 @@
},
"images": {
"optimize": [
"fileadmin",
"uploads"
"web/fileadmin",
"web/uploads"
]
},
"extensions": [
......
......@@ -44,6 +44,14 @@ rm -rf ./node_modules
npm install --depth 0
echo -e "\033[0;32mDependencies installed ✓\033[0m\n"
# copy config file if no present yet
if [ ! -e ../.sgc-config.json ]
then
cp ./gulp/sgc-config.template.json ../.sgc-config.json
echo -e "\033[0;32mSGC config file created ✓\033[0m\n"
else
echo -e "\033[0;34mSGC config file found. Skip config creation...\033[0m";
fi
if [ "$1" == "--local" ]; then
# install cli locally
......@@ -61,6 +69,7 @@ fi
. ./core/version.conf
echo "INSTALLED_SGC_VERSION=$SGC_VERSION" > .sgc_version
# go back to the root folder
cd ..
echo -e "\033[0;32msgc installed ✓\033[0m\n"
......
......@@ -3,7 +3,7 @@
"description": "sgalinski command line interface",
"repository": {
"type": "git",
"url": "git@gitlab.sgalinski.de:toolchain/website_base.git"
"url": "git@gitlab.sgalinski.de:toolchain/sgc.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment