Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Merge chore/share_configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Jul 6, 2018
2 parents 06ef18e + 972814f commit 0d9ae63
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 442 deletions.
3 changes: 1 addition & 2 deletions bin/nsc-build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
const commander = require('commander');

const config = require('../src/config');
const config = require('@node-sitecore/config');
const buildSolution = require('../src/build-solution');

commander
Expand Down
35 changes: 21 additions & 14 deletions bin/nsc-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,77 @@
/* eslint-disable no-param-reassign */

const inquirer = require('inquirer');
const config = require('../src/config');
const config = require('@node-sitecore/config');

const questions = [
{
type: 'input',
name: 'currentWebsite',
message: 'What is the code name of your website ?',
default: config.currentWebsite,
required: true
},
{
type: 'input',
name: 'siteUrl',
message: 'What is the website url ?',
default: config.siteUrl,
required: true,
required: true
},
{
type: 'input',
name: 'instanceRoot',
message: 'What is the path of your instance ?',
default: config.instanceRoot,
required: true,
required: true
},
{
type: 'input',
name: 'websiteRoot',
message: 'What is the relative path of your Website (from instanceRoot) ?',
default: config.get('websiteRoot'),
required: true,
required: true
},
{
type: 'input',
name: 'licensePath',
message: 'What is the relative path of license.xml (from instanceRoot) ?',
default: config.get('licensePath'),
required: true,
required: true
},
{
type: 'input',
name: 'sitecoreLibraries',
name: 'sitecoreLibrairiesRoot',
message: 'What is the relative path of the Sitecore librairies (from instanceRoot) ?',
default: config.get('sitecoreLibraries'),
required: true,
default: config.get('sitecoreLibrairiesRoot'),
required: true
},
{
type: 'input',
name: 'solutionName',
message: 'What is the name of your Solution.sln (MySitecore.sln) ?',
default: config.get('solutionName'),
required: true,
required: true
},
{
type: 'input',
name: 'buildToolsVersion',
message: 'What is the version of your Microsoft Build Tools (MsBuildTools) ?',
default: config.get('buildToolsVersion'),
required: true,
},
required: true
}
];

function runInteractive() {
return inquirer.prompt(questions)
.then((answers) => {
Object.keys(answers).forEach((key) => {
if (key === 'solutionName') {
answers[ key ] = answers[ key ].replace('.sln', '');
answers[key] = answers[key].replace('.sln', '');
}
config.set(key, answers[ key ] || config.get(key));
config.set(key, answers[key] || config.get(key));
});
config.writeConfiguration();
config.create();
});
}

Expand Down
1 change: 0 additions & 1 deletion bin/nsc-install.js

This file was deleted.

2 changes: 1 addition & 1 deletion bin/nsc-proxy-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const inquirer = require('inquirer');
const commander = require('commander');
const log = require('fancy-log');
const proxyServer = require('../src/proxy-server');
const config = require('../src/config');
const config = require('@node-sitecore/config');

commander
.alias('nsc proxy-server')
Expand Down
14 changes: 7 additions & 7 deletions bin/nsc-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const commander = require('commander');

const config = require('../src/config');
const config = require('@node-sitecore/config');
const publish = require('../src/publish');

let publishType = 'all';
Expand Down Expand Up @@ -105,27 +105,27 @@ switch (publishType) {
case 'all':
default:
paths = [
`${config.get('foundationPath')}/**/code/*.csproj`,
`${config.get('featurePath')}/**/code/*.csproj`,
`${config.get('projectPath')}/**/code/*.csproj`
`${config.get('foundationRoot')}/**/code/*.csproj`,
`${config.get('featureRoot')}/**/code/*.csproj`,
`${config.get('projectRoot')}/**/code/*.csproj`
];

break;
case 'Foundation':
paths = [
`${config.get('foundationPath')}/**/code/*.csproj`
`${config.get('foundationRoot')}/**/code/*.csproj`
];
break;

case 'Feature':
paths = [
`${config.get('featurePath')}/**/code/*.csproj`
`${config.get('featureRoot')}/**/code/*.csproj`
];
break;

case 'Project':
paths = [
`${config.get('featurePath')}/**/code/*.csproj`
`${config.get('featureRoot')}/**/code/*.csproj`
];
break;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/nsc-restore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
const config = require('../src/config');
const config = require('@node-sitecore/config');
const nugetRestore = require('../src/nuget-restore');

nugetRestore(config.solutionPath);
6 changes: 3 additions & 3 deletions bin/nsc-unicorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const inquirer = require('inquirer');
const log = require('fancy-log');
const chalk = require('chalk');
const unicorn = require('../src/unicorn');
const config = require('../src/config');
const config = require('@node-sitecore/config');

const options = {
action: 'wizard',
Expand Down Expand Up @@ -38,7 +38,7 @@ commander.on('--help', () => {
switch (options.action) {
default:

config.checkPreconditions();
// config.checkPreconditions();

unicorn
.getConfigurations()
Expand Down Expand Up @@ -67,7 +67,7 @@ switch (options.action) {
break;

case 'sync':
config.checkPreconditions();
// config.checkPreconditions();

unicorn.sync({
siteUrl: config.siteUrl,
Expand Down
1 change: 0 additions & 1 deletion bin/nsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ commander
.version(pkg.version)
.command('init', 'Init a Sitecore Project')
.command('restore', 'Restore all NuGet Packages')
// .command('install', 'Install a sitecore package')
.command('build', 'Build project solution')
.command('publish', 'Publish project solution')
.command('unicorn [action] [configs ...]', 'Perform a Unicorn synchronisation')
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
"license": "MIT",
"dependencies": {
"@node-sitecore/config": "^1.2.0",
"browser-sync": "^2.24.4",
"chalk": "^2.3.0",
"cli-table": "^0.3.1",
Expand All @@ -34,6 +35,7 @@
"has-yarn": "^1.0.0",
"inquirer": "^5.2.0",
"listr": "^0.14.1",
"nconf": "^0.10.0",
"request": "^2.87.0",
"request-promise-native": "^1.0.5",
"split": "^1.0.1",
Expand Down
Loading

0 comments on commit 0d9ae63

Please sign in to comment.