Commit 4a3fdc0e authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add sgc open task

parent d0c76394
......@@ -44,6 +44,7 @@ error here: https://gist.github.com/luislavena/f064211759ee0f806c88
* ```sgc js:qa```: Runs only the JS QA task (linting)
* ```sgc releaseExtension --ext {extension name}```: Starts a questionaire wich helps to update an extension according to SEMVER (updates composer.json and ext_emconf.php)
* ```sgc lighthouse```: **experimental** runs a lighthouse test suite against your site
* ```sgc open {sites}``` Opens a set of URLs in the default browser, that you can define inside your .sgc-config.json
You can call every command with the ```--production``` flag. This will prevent the toolchain from generating SourceMaps.
......
'use strict';
const open = require('opn');
const yargs = require('yargs').argv;
const settings = require('../../gulp/settings');
const chalk = require('chalk');
if (yargs._.length > 1) {
const config = settings.getConfig();
if (config.hasOwnProperty('open')) {
let sites = yargs._[1];
if (config.open.hasOwnProperty(sites)) {
config.open[sites].forEach(site => {
open(site);
});
} else {
console.log(chalk.red(`The desired entry ${sites} could not be found in your .sgc-config.json!`));
}
} else {
console.log(chalk.red('You have currently no sites configured (set the "open" property inside your .sgc-config.json)!'));
}
} else {
console.log(chalk.red('Please specify which site you want to open!'));
}
......@@ -51,5 +51,10 @@
"browsersync": {
"url": "https://www.website-base.dev",
"urlparams": "no_cache=1&disableScriptmerger=1"
},
"open": {
"dev": [
"https://website-base.dev"
]
}
}
......@@ -4222,6 +4222,10 @@ is-windows@^0.2.0:
version "0.2.0"
resolved is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c
is-wsl@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
is-zip@^1.0.0:
version "1.0.0"
resolved is-zip-1.0.0.tgz#47b0a8ff4d38a76431ccfd99a8e15a4c86ba2325
......@@ -5447,6 +5451,12 @@ opn@4.0.2:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
opn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519"
dependencies:
is-wsl "^1.1.0"
optimist@^0.6.1:
version "0.6.1"
resolved optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686
......
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