-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: install command not working for dotnetic
- Loading branch information
1 parent
a36dae3
commit 2a68b11
Showing
3 changed files
with
531 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
<?php namespace RockShell; | ||
|
||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class PwDownload extends Command { | ||
|
||
public function config() { | ||
$this | ||
->setDescription("Download ProcessWire") | ||
->addArgument("version", InputArgument::OPTIONAL, | ||
"ProcessWire version (master/dev)") | ||
; | ||
} | ||
|
||
public function handle() { | ||
$path = $this->app->rootPath(); | ||
chdir($path); | ||
$version = $this->argument('version') | ||
?: $this->askWithCompletion( | ||
"Which version?", | ||
['master', 'dev'], | ||
'dev' | ||
); | ||
$this->write("Downloading ProcessWire($version) to $path ..."); | ||
$this->exec("wget https://github.com/processwire/processwire/archive/$version.zip"); | ||
|
||
$this->write("Extracting files..."); | ||
$this->exec("unzip -q $version.zip"); | ||
|
||
// wait for unzip to be ready | ||
$cnt = 0; | ||
while(!is_dir("processwire-$version") AND ++$cnt < 30) { | ||
$this->write("waiting for unzip..."); | ||
sleep(1); | ||
} | ||
|
||
// cleanup | ||
// $this->exec("rm -rf processwire-$version"); | ||
$this->write("Cleaning up temporary files..."); | ||
$this->exec("rm $version.zip"); | ||
$this->exec("mv processwire-$version pwtmp | ||
mv pwtmp/* . | ||
mv pwtmp/.* ."); | ||
|
||
sleep(1); | ||
$this->exec("rm -rf pwtmp"); | ||
|
||
return self::SUCCESS; | ||
} | ||
|
||
} | ||
<?php namespace RockShell; | ||
|
||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class PwDownload extends Command { | ||
|
||
public function config() { | ||
$this | ||
->setDescription("Download ProcessWire") | ||
->addArgument("version", InputArgument::OPTIONAL, | ||
"ProcessWire version (master/dev)") | ||
; | ||
} | ||
|
||
public function handle() { | ||
$path = $this->app->rootPath(); | ||
chdir($path); | ||
$version = $this->argument('version') | ||
?: $this->askWithCompletion( | ||
"Which version?", | ||
['master', 'dev'], | ||
'dev' | ||
); | ||
$this->write("Downloading ProcessWire($version) to $path ..."); | ||
$this->exec("wget https://github.com/processwire/processwire/archive/$version.zip"); | ||
|
||
$this->write("Extracting files..."); | ||
$this->exec("unzip -q $version.zip"); | ||
|
||
// wait for unzip to be ready | ||
$cnt = 0; | ||
while(!is_dir("processwire-$version") AND ++$cnt < 30) { | ||
$this->write("waiting for unzip..."); | ||
sleep(1); | ||
} | ||
|
||
// cleanup | ||
// $this->exec("rm -rf processwire-$version"); | ||
$this->write("Cleaning up temporary files..."); | ||
$this->exec("rm $version.zip"); | ||
$this->exec("mv processwire-$version pwtmp"); | ||
$this->exec('mv pwtmp/* ./'); | ||
$this->exec('mv pwtmp/.* ./'); | ||
sleep(1); | ||
$this->exec("rm -rf pwtmp"); | ||
|
||
return self::SUCCESS; | ||
} | ||
|
||
} |
Oops, something went wrong.