Skip to content

Commit

Permalink
Merge pull request #111 from kittn/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Lars authored Apr 12, 2018
2 parents 557e56e + e715f86 commit 5ff84d8
Show file tree
Hide file tree
Showing 110 changed files with 5,272 additions and 3,283 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/**
195 changes: 131 additions & 64 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,28 @@ module.exports = class extends Generator {
var saltKeys = []

for (var i = 0; i < 8; i++) {
saltKeys.push(random.generate({
length: 64,
charset: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!§$%/()=_;:,.^'
}))
saltKeys.push(
random.generate({
length: 64,
charset:
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!§$%/()=_;:,.^'
})
)
}
this.saltKeys = saltKeys
}

// Initializing
// Initializing
async initializing () {
await Promise.all(Object.keys(this.commands)
.map(command => {
await Promise.all(
Object.keys(this.commands).map(command => {
return commandExists(command)
.then(commandResult => {
this.commands[commandResult] = true
})
.catch((error) => {})
}))
.catch(error => {})
})
)
}

prompting () {
Expand Down Expand Up @@ -124,7 +128,11 @@ module.exports = class extends Generator {

// Custom Greeting
var welcome = chalk`
{white.bold.bgCyan v${this.pkg.version} }{hex('#c9c9c9')
{white.bold.bgCyan v${
this
.pkg
.version
} }{hex('#c9c9c9')
------------------------------------------- {hex('#00ffd8') the revenge of the kittn } ---------------------------------------------
}
Expand All @@ -145,7 +153,7 @@ module.exports = class extends Generator {
this.props.projectcritical = this.props.projectcritical || false
this.props.fileGroup = this.props.fileGroup || false
this.props.fileUser = this.props.fileUser || false
this.props.projectnormalize = this.props.projectnormalize || 'regular'
this.props.projectnormalize = this.props.projectnormalize || 'regular';
this.props.projectjsframework = this.props.projectjsframework || false
})
}
Expand Down Expand Up @@ -226,75 +234,134 @@ module.exports = class extends Generator {
{cyan.bold Next Steps}`

goodbye += '\n\n'
goodbye += '\n\n';

if (this.props.projectusage.substring(0,4) === 'word' && this.commands.wp !== true) {
goodbye += chalk`{cyan - Install Wordpress manually in the 'dist/' directory}` + '\n'
}

if (this.props.projectusage.substring(0,5) === 'craft' && this.commands.wget !== true) {
goodbye += chalk`{cyan - Install Craft manually in the 'dist/' directory}` + '\n'
}

if (this.props.projectusage === 'wordpressCB') {
goodbye += chalk`{cyan - Copy your ACF5 Pro Plugin on 'src/structure/plugins/'}` + '\n'
}
if (
this.props.projectusage.substring(0, 4) === 'word' &&
this.commands.wp !== true
) {
goodbye +=
chalk`{cyan - Install Wordpress manually in the 'dist/' directory}` +
'\n';
}

if (os.type() === 'Darwin') {
if (this.props.projectusage !== 'html' && this.props.projectcredential) {
goodbye += chalk`{cyan - Use the './install.sh' Shellscript to skip the following steps.}` + '\n'
}
if (
this.props.projectusage.substring(0, 5) === 'craft' &&
this.commands.wget !== true
) {
goodbye +=
chalk`{cyan - Install Craft manually in the 'dist/' directory}` +
'\n';
}

if (this.props.projectusage === 'html') {
goodbye += chalk`{cyan - Initiate the project with 'npm run init'}` + '\n'
}
if (this.props.projectusage === 'wordpressCB') {
goodbye +=
chalk`{cyan - Copy your ACF5 Pro Plugin on 'src/structure/plugins/'}` +
'\n';
}

} else {
if (this.props.projectusage === 'craft' || this.props.projectusage === 'craftCB') {
goodbye += chalk`{cyan - Setup User and Staff on 'craftscripts/.env.sh'}` + '\n'
}

if (this.props.projectusage !== 'webpackApp') {
goodbye += chalk`{cyan - Initiate the project with 'npm run init'}` + '\n'
}

if (this.props.projectusage.substring(0,5) === 'craft') {
goodbye += chalk`{cyan - Execute './craftscripts/set_perms.sh'}` + '\n'
}

if (this.props.projectusage !== 'html' && this.props.projectusage !== 'webpackApp') {
const folder = this.props.projectusage.substring(0, 5) === 'craft' ? 'public/' : ''
goodbye += chalk`{cyan - Import database.sql found on project root}` + '\n'
}

if (this.props.projectusage !== 'html' && this.props.projectusage !== 'webpackApp' && this.props.projectcredential) {
goodbye += chalk`{cyan => 'mysql -u${this.props.credentialdbuser} -p${this.props.credentialdbpass} ${this.props.credentialdbdatabase} < database.sql'}` + '\n\n'
}
if (os.type() === 'Darwin') {
if (this.props.projectusage !== 'html' && this.props.projectcredential) {
goodbye +=
chalk`{cyan - Use the './install.sh' Shellscript to skip the following steps.}` +
'\n';
}

if (this.props.projectusage !== 'html' && this.props.projectusage !== 'webpackApp') {
const folder = this.props.projectusage.substring(0, 5) === 'craft' ? 'public/' : ''
const domain = this.props.credentialdomain ? this.props.credentialdomain : ''
goodbye += chalk`{hex('#009dff') - Define vHost for '${domain}' on '[projectRoot]/dist/${folder}'}` + '\n'
if (this.props.projectusage === 'html') {
goodbye +=
chalk`{cyan - Initiate the project with 'npm run init'}` + '\n';
}
} else {
if (
this.props.projectusage === 'craft' ||
this.props.projectusage === 'craftCB'
) {
goodbye +=
chalk`{cyan - Setup User and Staff on 'craftscripts/.env.sh'}` +
'\n';
}

if (this.props.projectusage !== 'html' && this.props.projectusage !== 'webpackApp') {
goodbye += chalk`{hex('#009dff') - Log into the backend with 'kittn' / '${this.props.projectusage.substring(0,5) === 'craft' ? `superkittn` : `kittn` }'. After login, activate theme and create a new user}` + '\n'
if (this.props.projectusage !== 'webpackApp') {
goodbye +=
chalk`{cyan - Initiate the project with 'npm run init'}` + '\n';
}

if (this.props.projectcredential) {
goodbye += chalk`{hex('#009dff') => Backend: ${this.props.credentialdomain}/${this.props.projectusage.substring(0,5) === 'craft' ? `admin` : `wp-admin` }}` + '\n'
if (this.props.projectusage.substring(0, 5) === 'craft') {
goodbye +=
chalk`{cyan - Execute './craftscripts/set_perms.sh'}` + '\n';
}

if (this.props.projectusage === 'craftCB') {
goodbye += chalk`{cyan.bold If you want to use the Craft Personal version, you must deactivate the localization before you switch.. }` + '\n'
if (
this.props.projectusage !== 'html' &&
this.props.projectusage !== 'webpackApp'
) {
const folder =
this.props.projectusage.substring(0, 5) === 'craft' ? 'public/' : '';
goodbye +=
chalk`{cyan - Import database.sql found on project root}` + '\n';
}

if (this.props.projectusage === 'webpackApp') {
goodbye += chalk`{cyan - Build your App with 'npm run build'}` + '\n'
if (
this.props.projectusage !== 'html' &&
this.props.projectusage !== 'webpackApp' &&
this.props.projectcredential
) {
goodbye +=
chalk`{cyan => 'mysql -u${this.props.credentialdbuser} -p${
this.props.credentialdbpass
} ${this.props.credentialdbdatabase} < database.sql'}` + '\n\n';
}
}

if (
this.props.projectusage !== 'html' &&
this.props.projectusage !== 'webpackApp'
) {
const folder =
this.props.projectusage.substring(0, 5) === 'craft' ? 'public/' : '';
const domain = this.props.credentialdomain
? this.props.credentialdomain
: '';
goodbye +=
chalk`{hex('#009dff') - Define vHost for '${domain}' on '[projectRoot]/dist/${folder}'}` +
'\n';
}

if (
this.props.projectusage !== 'html' &&
this.props.projectusage !== 'webpackApp'
) {
goodbye +=
chalk`{hex('#009dff') - Log into the backend with 'kittn' / '${
this.props.projectusage.substring(0, 5) === 'craft'
? `superkittn`
: `kittn`
}'. After login, activate theme and create a new user}` + '\n';
}

if (this.props.projectcredential) {
goodbye +=
chalk`{hex('#009dff') => Backend: ${
this.props.credentialdomain
}/${
this.props.projectusage.substring(0, 5) === 'craft'
? `admin`
: `wp-admin`
}}` + '\n';
}

if (this.props.projectusage === 'craftCB') {
goodbye +=
chalk`{cyan.bold If you want to use the Craft Personal version, you must deactivate the localization before you switch.. }` +
'\n';
}

if (this.props.projectusage === 'webpackApp') {
goodbye +=
chalk`{cyan - Build your App with 'npm run build'}` + '\n';
}

goodbye += chalk`{hex('#009dff') - Start the devtask with 'npm run dev'}
goodbye += chalk`{hex('#009dff') - Start the devtask with 'npm run dev'}
{hex('#94ff00').bold Happy Coding.}`

Expand Down
Loading

0 comments on commit 5ff84d8

Please sign in to comment.