Skip to content

Commit d74e191

Browse files
Update uploads and downloads to be recursive by default
1 parent 4923416 commit d74e191

12 files changed

+10
-30
lines changed

src/Scp.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ protected function getExtraOptions(): string
5353
{
5454
$extraOptions = [];
5555

56+
$extraOptions[] = '-r';
57+
5658
if ($this->pathToPrivateKey) {
5759
$extraOptions[] = "-i {$this->pathToPrivateKey}";
5860
}
@@ -66,10 +68,6 @@ protected function getExtraOptions(): string
6668
$extraOptions[] = '-o UserKnownHostsFile=/dev/null';
6769
}
6870

69-
if ($this->recursive) {
70-
$extraOptions[] = '-r';
71-
}
72-
7371
return implode(' ', $extraOptions);
7472
}
7573
}

tests/ScpTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@ public function it_can_upload_a_file()
3636
$this->assertMatchesSnapshot($command);
3737
}
3838

39-
/** @test */
40-
public function it_can_download_files_recursively()
41-
{
42-
$command = $this->scp->recursive()->getDownloadCommand('spatie.be/current', 'downloads');
43-
44-
$this->assertMatchesSnapshot($command);
45-
}
46-
47-
/** @test */
48-
public function it_can_upload_files_recursively()
49-
{
50-
$command = $this->scp->recursive()->getUploadCommand('uploads', 'spatie.be/current');
51-
52-
$this->assertMatchesSnapshot($command);
53-
}
54-
5539
/** @test */
5640
public function it_can_use_a_specific_private_key()
5741
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@example.com:spatie.be/current/.env .env
1+
scp -r -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@example.com:spatie.be/current/.env .env
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp user@example.com:spatie.be/current/.env .env
1+
scp -r user@example.com:spatie.be/current/.env .env

tests/__snapshots__/ScpTest__it_can_download_files_recursively__1.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp user@example.com:spatie.be/current/.env .env
1+
scp -r user@example.com:spatie.be/current/.env .env
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp -P 123 user@example.com:spatie.be/current/.env .env
1+
scp -r -P 123 user@example.com:spatie.be/current/.env .env
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp -P 123 user@example.com:spatie.be/current/.env .env
1+
scp -r -P 123 user@example.com:spatie.be/current/.env .env
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scp .env user@example.com:spatie.be/current/.env
1+
scp -r .env user@example.com:spatie.be/current/.env

tests/__snapshots__/ScpTest__it_can_upload_files_recursively__1.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)