Skip to content

Commit 89ce99a

Browse files
committed
add installers for react/vue sdks
1 parent d3f0aa0 commit 89ce99a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Console/ReactCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace CloudinaryLabs\CloudinaryLaravel\Console;
44

55
use Illuminate\Console\Command;
6+
use Symfony\Component\Process\Process;
67

78
class ReactCommand extends Command
89
{
@@ -15,5 +16,15 @@ class ReactCommand extends Command
1516
public function handle()
1617
{
1718
$this->info('Installing Cloudinary React components...');
19+
20+
$process = new Process(['npm', 'install', '@cloudinary/react', '@cloudinary/url-gen']);
21+
22+
$process->run(function ($type, $line) {
23+
$this->output->write($line);
24+
});
25+
26+
$this->line(' ');
27+
$this->info('Cloudinary React components installed successfully.');
28+
$this->line('Read getting started: https://cloudinary.com/documentation/react_quick_start');
1829
}
1930
}

src/Console/VueCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace CloudinaryLabs\CloudinaryLaravel\Console;
44

55
use Illuminate\Console\Command;
6+
use Symfony\Component\Process\Process;
67

78
class VueCommand extends Command
89
{
@@ -15,5 +16,15 @@ class VueCommand extends Command
1516
public function handle()
1617
{
1718
$this->info('Installing Cloudinary Vue components...');
19+
20+
$process = new Process(['npm', 'install', '@cloudinary/vue', '@cloudinary/url-gen']);
21+
22+
$process->run(function ($type, $line) {
23+
$this->output->write($line);
24+
});
25+
26+
$this->line(' ');
27+
$this->info('Cloudinary Vue components installed successfully.');
28+
$this->line('Read getting started: https://cloudinary.com/documentation/vue_quick_start');
1829
}
1930
}

0 commit comments

Comments
 (0)