Skip to content

Commit

Permalink
fix commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuder committed Apr 1, 2022
1 parent 3ac5464 commit cc12c5f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## [1.0.6]
- fix: git - commands

## [1.0.5]
- fix: git - delete directory if exists

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flux-eco/source-downloader",
"description": "Component for flux-capacitor apps developed by fluxlabs",
"version": "1.0.5",
"version": "1.0.6",
"type": "flux-eco",
"keywords": [
"flux-eco",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ public function handle(Command $command) : void
return;
}

$deleteDirectory = '';
$createDirectory = 'mkdir -p ' . $command->getDirectoryPath();
if(is_dir($command->getDirectoryPath())) {
$deleteDirectory = 'rm -r ' . $command->getDirectoryPath();
$createDirectory = 'rm -r ' . $command->getDirectoryPath().' && '.$createDirectory;
}
$createDirectory = $deleteDirectory .' && mkdir -p ' . $command->getDirectoryPath();
$cdDirectory = 'cd ' . $command->getDirectoryPath();
$cloneRepository = 'git clone --branch ' . $command->getTag() . ' ' . $command->getUrl() . ' ' . $command->getDirectoryName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ public function handle(Command $command) : void
return;
}

$deleteDirectory = '';
$createDirectory = 'mkdir -p ' . $command->getDirectoryPath();
if(is_dir($command->getDirectoryPath())) {
$deleteDirectory = 'rm -r ' . $command->getDirectoryPath();
$createDirectory = 'rm -r ' . $command->getDirectoryPath().' && '.$createDirectory;
}
$createDirectory = $deleteDirectory .' && mkdir -p ' . $command->getDirectoryPath();
$cdDirectory = 'cd ' . $command->getDirectoryPath();
$cloneRepository = 'git clone --depth 1 --branch '.$command->getTag() .' '. $command->getUrl().' '.$command->getDirectoryName();

$this->shellExecutorClient->execute([$deleteDirectory, $createDirectory, $cdDirectory, $cloneRepository]);
$this->shellExecutorClient->execute([$createDirectory, $cdDirectory, $cloneRepository]);
}
}

0 comments on commit cc12c5f

Please sign in to comment.