2020-05-27 20:47:53 +03:00
|
|
|
const config = require('./core/shared/config');
|
2019-02-11 15:26:06 +03:00
|
|
|
|
2021-07-05 22:02:22 +03:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
// --- Configuration
|
2022-08-08 14:03:49 +03:00
|
|
|
grunt.initConfig({
|
2022-08-05 10:53:08 +03:00
|
|
|
shell: {
|
|
|
|
ember: {
|
|
|
|
command: function (mode) {
|
|
|
|
const liveReloadBaseUrl = config.getSubdir() || '/ghost/';
|
|
|
|
|
|
|
|
switch (mode) {
|
2022-08-05 11:01:09 +03:00
|
|
|
case 'watch':
|
2022-07-25 20:28:41 +03:00
|
|
|
return `yarn start --live-reload-base-url=${liveReloadBaseUrl} --live-reload-port=4201`;
|
2022-08-05 10:53:08 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
execOptions: {
|
|
|
|
cwd: '../admin'
|
|
|
|
}
|
|
|
|
}
|
2019-02-11 15:26:06 +03:00
|
|
|
},
|
2013-08-01 11:12:59 +04:00
|
|
|
|
2022-08-05 10:53:08 +03:00
|
|
|
options: {
|
|
|
|
preferLocal: true
|
2019-02-11 15:26:06 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-07-05 22:02:22 +03:00
|
|
|
// grunt-contrib-symlink
|
2019-02-11 15:26:06 +03:00
|
|
|
// 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'
|
|
|
|
}
|
|
|
|
}
|
2022-08-08 14:03:49 +03:00
|
|
|
});
|
2019-02-11 15:26:06 +03:00
|
|
|
|
2021-07-05 22:02:22 +03:00
|
|
|
// Load all grunt tasks
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-symlink');
|
2022-08-05 10:53:08 +03:00
|
|
|
grunt.loadNpmTasks('grunt-shell');
|
2019-02-11 15:26:06 +03:00
|
|
|
};
|