Skip to content

Instantly share code, notes, and snippets.

@nielsnuebel
Created April 18, 2018 16:45
Show Gist options
  • Save nielsnuebel/fadd5fca7747cc508b7b5ce5bb670f32 to your computer and use it in GitHub Desktop.
Save nielsnuebel/fadd5fca7747cc508b7b5ce5bb670f32 to your computer and use it in GitHub Desktop.
const installJoomla = () => {
return {
install: (context) => {
return new Promise((resolve, reject) => {
if (context.props.projectusage === 'joomla') {
if (context.commands.wget) {
context.spawnCommand('wget', ['http://buildwithcraft.com/latest.tar.gz\?accept_license\=yes']).on('close', () => {
context.spawnCommand('mkdir', ['dist']).on('close', () => {
context.spawnCommand('tar', ['-zxvf', 'latest.tar.gz\?accept_license=yes', 'craft/']).on('close', () => {
context.spawnCommand('mv', ['craft', 'dist/']).on('close', () => {
context.spawnCommand('rm', ['-rf', 'latest.tar.gz\?accept_license=yes']).on('close', () => {
resolve()
})
})
})
})
})
// For the Future CRAFT3.0 Composer Power
// this.spawnCommand('composer', ['create-project', 'craftcms/craft', 'dist', '-s', 'beta']).on('close', () => {
// resolve()
// })
} else {
context.log('Before you run `npm run init`, you must manually install Joomla in the `dist/` directory.')
resolve()
}
} else {
resolve()
}
})
}
}
}
module.exports = installJoomla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment