mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 12:30:35 +01:00
Fix potenziale per generazione database.json da Windows
This commit is contained in:
parent
ef22b90246
commit
6012fa34cd
22
gulpfile.js
22
gulpfile.js
@ -369,6 +369,18 @@ function phpDebugBar() {
|
|||||||
.pipe(gulp.dest(config.production + '/php-debugbar'));
|
.pipe(gulp.dest(config.production + '/php-debugbar'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatPHPExec(exec) {
|
||||||
|
let php_exec;
|
||||||
|
let is_windows = process.platform === "win32";
|
||||||
|
if (is_windows) {
|
||||||
|
php_exec = `php -r "` + exec.split("\n").join("") + `"`;
|
||||||
|
} else {
|
||||||
|
php_exec = `php -r '` + exec.split("'").join('"') + `'`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return php_exec;
|
||||||
|
}
|
||||||
|
|
||||||
// Operazioni per la release
|
// Operazioni per la release
|
||||||
function release(done) {
|
function release(done) {
|
||||||
// Impostazione dello zip
|
// Impostazione dello zip
|
||||||
@ -439,14 +451,16 @@ function release(done) {
|
|||||||
archive.file('checksum.json', {});
|
archive.file('checksum.json', {});
|
||||||
|
|
||||||
// Aggiunta del file per il controllo di integrità del database
|
// Aggiunta del file per il controllo di integrità del database
|
||||||
archive.append(shell.exec(`php -r '
|
let exec = `
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
$skip_permissions = true;
|
$skip_permissions = true;
|
||||||
include_once __DIR__."/core.php";
|
include_once __DIR__.DIRECTORY_SEPARATOR.'core.php';
|
||||||
$info = Update::getDatabaseStructure();
|
$info = Update::getDatabaseStructure();
|
||||||
$response = json_encode($info);
|
$response = json_encode($info);
|
||||||
echo $response;
|
echo $response;`;
|
||||||
'`, {
|
let php_exec = formatPHPExec(exec);
|
||||||
|
|
||||||
|
archive.append(shell.exec(php_exec, {
|
||||||
silent: true
|
silent: true
|
||||||
}).stdout, {
|
}).stdout, {
|
||||||
name: 'database.json'
|
name: 'database.json'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user