Skip to content

Commit

Permalink
only delete concrete directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuder committed Apr 1, 2022
1 parent cc12c5f commit 908f135
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# CHANGELOG

## [1.0.7]
- fix: git - only delete concrete directory

## [1.0.6]
- fix: git - commands
- 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.6",
"version": "1.0.7",
"type": "flux-eco",
"keywords": [
"flux-eco",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function handle(Command $command) : void
}

$createDirectory = 'mkdir -p ' . $command->getDirectoryPath();
if(is_dir($command->getDirectoryPath())) {
$createDirectory = 'rm -r ' . $command->getDirectoryPath().' && '.$createDirectory;
if(is_dir($command->getDirectoryPath()).'/'.$command->getDirectoryName()) {
$createDirectory = 'rm -r ' . $command->getDirectoryPath().'/'.$command->getDirectoryName().' && '.$createDirectory;
}
$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 @@ -33,8 +33,8 @@ public function handle(Command $command) : void
}

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

0 comments on commit 908f135

Please sign in to comment.