Skip to content

Commit

Permalink
Merge branch 'release/4.0.0' into feature/scotty
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Huber committed Nov 3, 2024
2 parents 6809b12 + d294857 commit 3882f6e
Show file tree
Hide file tree
Showing 6 changed files with 838 additions and 828 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.8.33](https://github.com/factorial-io/phabalicious/compare/3.8.32...3.8.33) (2024-10-25)


### Bug Fixes

* temp dir is different per user now to provide permission issues ([5f44bfe](https://github.com/factorial-io/phabalicious/commit/5f44bfe692e99e875fc4828c34e3bad4346f421c))

### [3.8.32](https://github.com/factorial-io/phabalicious/compare/3.8.30...3.8.32) (2024-10-25)


### Features

* Add option `output` to command `get:sql-dump` to set output file ([9414624](https://github.com/factorial-io/phabalicious/commit/94146244032eb1da5d4be1100c93fe0faf94df33))
* Add support for custom propnames to retrieve secrets from other props than `password` ([7e9b4be](https://github.com/factorial-io/phabalicious/commit/7e9b4beec7af85607d38d53851399d111bfe43c7))


### Bug Fixes

* Delete db backups from local, when restic backup is finished. Fixes [#332](https://github.com/factorial-io/phabalicious/issues/332) ([04c9617](https://github.com/factorial-io/phabalicious/commit/04c96170560c6b9e53776f7d40f56b9ef76a08dc))
* Fix shell execution for commands which do not print a final EOL ([58f81ba](https://github.com/factorial-io/phabalicious/commit/58f81ba7427663019d146be4562ea361189dd8c1))
* Fix shell execution for commands which do not print a final EOL ([25578a1](https://github.com/factorial-io/phabalicious/commit/25578a160e1ddebd1b7d3c48805b6b01ab883fb1))

### [3.8.31](https://github.com/factorial-io/phabalicious/compare/3.8.30...3.8.31) (2024-08-30)


Expand Down
14 changes: 14 additions & 0 deletions fabfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: git-tests


hosts:
base:
type: dev
needs:
- local
- git

hostA:
inheritsFrom: base
branch: master

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phabalicious",
"version": "3.8.31",
"version": "3.8.33",
"main": "index.js",
"repository": "https://github.com/factorial-io/phabalicious.git",
"author": "Stephan Huber <[email protected]>",
Expand All @@ -9,7 +9,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.1",
"@commitlint/config-conventional": "^17.0.0",
"@factorial/docs": "^0.4.1",
"@factorial/docs": "^0.5.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "3.3.0",
"cz-customizable": "^7.0.0",
Expand Down
12 changes: 10 additions & 2 deletions src/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ public function registerContainerConfiguration(LoaderInterface $loader)
*/
public function getCacheDir(): string
{
return sys_get_temp_dir() . '/phabalicious' . Utilities::FALLBACK_VERSION . md5(self::class);

$dir = implode('-', [
sys_get_temp_dir() . '/phabalicious',
Utilities::FALLBACK_VERSION,
getmyuid() ,
md5(self::class)
]);

return $dir;
}
/**
* Unique logs path for this Kernel
*/
public function getLogDir(): string
{
return sys_get_temp_dir() . '/phabalicious' . Utilities::FALLBACK_VERSION . md5(self::class);
return $this->getCacheDir();
}

protected function build(ContainerBuilder $containerBuilder)
Expand Down
9 changes: 7 additions & 2 deletions src/ShellProvider/LocalShellProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ public function run(string $command, $capture_output = false, $throw_exception_o
$lines = explode("\n", trim($this->process->getErrorOutput()));
}

# Remove any empty lines from the end.
while (count($lines) > 0 && empty($lines[count($lines) - 1])) {
array_pop($lines);
}

$cr = new CommandResult($exit_code, $lines);
if ($cr->failed() && !$capture_output && $throw_exception_on_error) {
$cr->throwException(sprintf('`%s` failed!', $command));
Expand Down Expand Up @@ -374,14 +379,14 @@ protected function sendCommandToShell(string $command, bool $include_result_iden
}

$command = sprintf("cd %s && %s", $this->getWorkingDir(), $this->expandCommand($command));
if (substr($command, -1) == ';') {
if (substr($command, -1) === ';') {
$command = substr($command, 0, -1);
}
$this->logger->log($this->loglevel->get(), $command);

// Send to shell.
$input = $include_result_identifier
? $command . '; echo \n"' . self::RESULT_IDENTIFIER . '$?"' . PHP_EOL
? $command . '; printf "\n' . self::RESULT_IDENTIFIER . '$?"' . PHP_EOL
: $command . PHP_EOL;

$this->input->write($input);
Expand Down
Loading

0 comments on commit 3882f6e

Please sign in to comment.