Skip to content

Commit

Permalink
add copy env to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
vmitchell85 committed Apr 6, 2017
1 parent 9c6f497 commit 7a131e6
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 179 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Latest stable version is tagged with a release and uploaded to [Packal.org](http
- `forge key {key}` : Sets your Forge API Key
- `forge open {site or server}` OR `fo {site or server}` : Opens the specified server or site's Forge page in your browser
- `forge deploy {site}` : Deploys the site specified (must confirm)
- `forge env {site}` : Copies the env file of the site specified to your clipboard
- `forge ip {server}` : Copies the ip address of the specified server to your clipboard
- `forge reboot {server}` : Reboots the specified server (must confirm)
- `forge mysql {server}` : Restarts MySQL on the specified server (must confirm)
Expand Down
Binary file modified alForge.alfredworkflow
Binary file not shown.
28 changes: 28 additions & 0 deletions src/alforge/Env.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace AlForge;

use AlForge\Forge;
use Alfred\Workflows\Workflow;

class Env extends Forge
{
public function search($query)
{
echo $this->siteSearch($query);
}

public function execute($command)
{

$cmdParts = split(' ', $command);

$server = $this->getServerInfo($cmdParts[0]);
$site = $this->getSiteInfo($cmdParts[0], $cmdParts[1]);

$response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$cmdParts[0]/sites/$cmdParts[1]/env", "GET");

$this->respond($response);

}
}
Loading

0 comments on commit 7a131e6

Please sign in to comment.