From 5e877dd374356b109de759b2af0b59147941f8e4 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 13 Dec 2019 11:57:45 +0200 Subject: [PATCH] grunt fixes --- Gruntfile.js | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 87179e9aac..151e5438a7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -166,6 +166,9 @@ module.exports = function (grunt) { }) }, copy: { + options: { + mode: true, + }, frontendFolders: { expand: true, cwd: 'client', @@ -227,9 +230,6 @@ module.exports = function (grunt) { }, }, chmod: { - options: { - mode: '755' - }, php: { options: { mode: '644' @@ -258,7 +258,21 @@ module.exports = function (grunt) { 'build/EspoCRM-<%= pkg.version %>/api/v1/portal-access', 'build/EspoCRM-<%= pkg.version %>', ] - } + }, + foldersWritable: { + options: { + mode: '775' + }, + src: [ + 'build/EspoCRM-<%= pkg.version %>/data', + 'build/EspoCRM-<%= pkg.version %>/custom', + 'build/EspoCRM-<%= pkg.version %>/custom/Espo', + 'build/EspoCRM-<%= pkg.version %>/custom/Espo/Custom', + 'build/EspoCRM-<%= pkg.version %>/client/custom', + 'build/EspoCRM-<%= pkg.version %>/client/modules', + 'build/EspoCRM-<%= pkg.version %>/application/Espo/Modules', + ] + }, }, replace: { version: { @@ -280,6 +294,10 @@ module.exports = function (grunt) { }, }); + grunt.registerTask("chmod-folders", function() { + cp.execSync("find . -type d -exec chmod 755 {} + ", {stdio: 'ignore', cwd: 'build/EspoCRM-' + pkg.version}); + }); + grunt.registerTask("composer", function() { cp.execSync("composer install", {stdio: 'ignore'}); }); @@ -288,11 +306,11 @@ module.exports = function (grunt) { cp.execSync("node diff --all --vendor", {stdio: 'inherit'}); }); - grunt.registerTask("unitTests", function() { + grunt.registerTask("unit-tests", function() { cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/unit", {stdio: 'inherit'}); }); - grunt.registerTask("integrationTests", function() { + grunt.registerTask("integration-tests", function() { cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/integration", {stdio: 'inherit'}); }); @@ -344,7 +362,10 @@ module.exports = function (grunt) { 'replace', 'clean:beforeFinal', 'copy:final', - 'chmod', + 'chmod-folders', + 'chmod:php', + 'chmod:folders', + 'chmod:foldersWritable', 'clean:final', ]); @@ -362,8 +383,8 @@ module.exports = function (grunt) { grunt.registerTask('tests', [ 'default', - 'unitTests', - 'integrationTests', + 'unit-tests', + 'integration-tests', ]); grunt.registerTask('dev', [