mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
e1984c8607
- most of these tasks were duplicates or had been extracted out into npm/yarn scripts - in order to get closer to removing Grunt, I've cleaned up the majority of those script - this also removes an intermediate command to building Admin, so it starts ever so slightly quicker
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
const config = require('./core/shared/config');
|
|
|
|
module.exports = function (grunt) {
|
|
// --- Configuration
|
|
grunt.initConfig({
|
|
shell: {
|
|
ember: {
|
|
command: function (mode) {
|
|
const liveReloadBaseUrl = config.getSubdir() || '/ghost/';
|
|
|
|
switch (mode) {
|
|
case 'watch':
|
|
return `yarn start --live-reload-base-url=${liveReloadBaseUrl} --live-reload-port=4201`;
|
|
}
|
|
},
|
|
options: {
|
|
execOptions: {
|
|
cwd: '../admin'
|
|
}
|
|
}
|
|
},
|
|
|
|
options: {
|
|
preferLocal: true
|
|
}
|
|
},
|
|
|
|
// grunt-contrib-symlink
|
|
// Create symlink for git hooks
|
|
symlink: {
|
|
githooks: {
|
|
// Enable overwrite to delete symlinks before recreating them
|
|
overwrite: false,
|
|
// Enable force to overwrite symlinks outside the current working directory
|
|
force: false,
|
|
// Expand to all files in /hooks
|
|
expand: true,
|
|
cwd: '.github/hooks',
|
|
src: ['*'],
|
|
dest: '.git/hooks'
|
|
}
|
|
}
|
|
});
|
|
|
|
// Load all grunt tasks
|
|
grunt.loadNpmTasks('grunt-contrib-symlink');
|
|
grunt.loadNpmTasks('grunt-shell');
|
|
};
|