Created
April 18, 2018 16:45
-
-
Save nielsnuebel/fadd5fca7747cc508b7b5ce5bb670f32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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