Skip to content

Commit

Permalink
fix: install command not working for dotnetic
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jul 13, 2023
1 parent a36dae3 commit 2a68b11
Show file tree
Hide file tree
Showing 3 changed files with 531 additions and 531 deletions.
102 changes: 51 additions & 51 deletions App/Commands/PwDownload.php
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;
}

}

0 comments on commit 2a68b11

Please sign in to comment.