Skip to content

Commit

Permalink
feat: add Symlink command
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jun 29, 2023
1 parent 19aa16e commit c664ec6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions App/Commands/Symlink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace RockShell;

class Symlink extends Command
{

public function config()
{
$this->setDescription("Creates a rockshell symlink in the PW root folder");
}

public function handle()
{
$root = $this->wire()->getRootPath();
$this->exec("cd $root && ln -snf RockShell/rockshell rockshell", false);
$dst = "{$root}rockshell";
if (is_file($dst)) $this->success("Symlink created at $dst");
else $this->error("Error creating symlink at $dst");
return self::SUCCESS;
}
}

0 comments on commit c664ec6

Please sign in to comment.