-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Add version v1.10.0 and plugin v1.2.0. (#22)
* Feature/diff command (#20) * [ADD] Add diff command - update AwsUpload handle diff / df agrs - add DiffCommand * [ADD] Add editor config file * [ADD] Add RsyncCommands - add interface to scope the const to define the available commands you can perform on rsync * [MOD] Restructure Rsync to handle different commands - update RsyncTest to test getExclude, upload and diff commands - update DiffCommand to use RsyncCommands - update UploadCommand to use RsyncCommands * [MOD] Update help message, add diff * [MOD] Update CHANGELOG for diff command * [MOD] Update phpdocs Rsync * [MOD] Fix spacing * [FIX] Fix no editor no sed (#21) * [FIX] Fix case no $EDITOR variable present - update SettingFile to get a default editor - update tests for Envs and SettingFiles * [FIX] Replace sed to activate aws-upload plugin - change algorithm to activate plugin - create test cases * [REF] Extract getEditor from SettingFile to System * [REF] Extract updatePluginLine from OhMyZsh::activate * [FIX] Fix case * in diff * [REF] Fix indetation issues * WIP * WIP * [REF] Restructure OhMyZsh extract Zshrc * WIP * [MOD] Update CHANGELOG and and version in aws-upload * WIP * [FIX] Line ending unix * [FIX] Line ending * WIP * WIP * [MOD] Update autocomplete as well on selfupdate
- Loading branch information
1 parent
2403752
commit bedb47d
Showing
37 changed files
with
764 additions
and
169 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
end_of_line = lf | ||
trim_trailing_whitespace = true |
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
/** | ||
* aws-upload - 🌈 A delicious CLI Tool for uploading files to ec2 | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this package in the file LICENSE. | ||
* | ||
* @author Marco Buttini <[email protected]> | ||
* @copyright 2017 Marco Buttini | ||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | ||
*/ | ||
|
||
namespace AwsUpload\Command; | ||
|
||
use AwsUpload\Model\Status; | ||
use AwsUpload\System\Rsync; | ||
use AwsUpload\Setting\SettingFile; | ||
use AwsUpload\Message\RsyncMessage; | ||
use AwsUpload\System\RsyncCommands; | ||
|
||
class DiffCommand extends FileCommand | ||
{ | ||
/** | ||
* Property true if app is simulate. | ||
* | ||
* @var bool | ||
*/ | ||
public $is_simulate; | ||
|
||
/** | ||
* Property true if app is verbose. | ||
* | ||
* @var bool | ||
*/ | ||
public $is_verbose; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $key; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $proj; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $env; | ||
|
||
public function init() | ||
{ | ||
$this->key = $this->app->args->getFirst('diff'); | ||
$this->is_verbose = $this->app->args->verbose; | ||
$this->is_simulate = $this->app->args->simulate; | ||
|
||
list($proj, $env) = explode('.', $this->key); | ||
$this->proj = $proj; | ||
$this->env = $env; | ||
} | ||
|
||
/** | ||
* Method to run the rsync cmd. | ||
* | ||
* @return mixed The status code. | ||
*/ | ||
public function exec() | ||
{ | ||
$settings = SettingFile::getObject($this->key); | ||
|
||
$rsync = new Rsync($settings); | ||
$rsync->setVerbose($this->is_verbose); | ||
$rsync->setAction(RsyncCommands::DIFF); | ||
|
||
$msg = RsyncMessage::banner($this->proj, $this->env, $rsync->cmd); | ||
$this->app->inline($msg); | ||
|
||
if ($this->is_simulate) { | ||
$this->app->inline($rsync->getCmd()); | ||
return $this->simulate(); | ||
} | ||
|
||
$rsync->run(); | ||
} | ||
|
||
public function simulate() | ||
{ | ||
$this->msg = 'Simulation mode' . "\n"; | ||
|
||
return $this->handleSuccess(); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.