1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Robo task for CS fixes

This commit is contained in:
J. King 2017-12-19 22:19:34 -05:00
parent 793af17c22
commit 67ecaee1f6
3 changed files with 17 additions and 1 deletions

View file

@ -128,4 +128,13 @@ class RoboFile extends \Robo\Tasks {
$this->_exec("git worktree prune"); $this->_exec("git worktree prune");
return $out; return $out;
} }
public function clean($opts = ['demo|d' => false]): Result {
$t = $this->taskExec(realpath(self::BASE."vendor/bin/php-cs-fixer"));
$t->arg("fix");
if ($opts['demo']) {
$t->args("--dry-run", "--diff")->option("--diff-format", "udiff");
}
return $t->run();
}
} }

6
robo
View file

@ -3,4 +3,8 @@ base=`dirname "$0"`
roboCommand="$1" roboCommand="$1"
shift shift
"$base/vendor/bin/robo" "$roboCommand" -- $* if [ "$1" == "clean" ]; then
"$base/vendor/bin/robo" "$roboCommand" $*
else
"$base/vendor/bin/robo" "$roboCommand" -- $*
fi

View file

@ -14,4 +14,7 @@ if "%~1" neq "" (
) )
if defined args set args=%args:~1% if defined args set args=%args:~1%
if not "%1"=="clean" (
call "%base%vendor\bin\robo" "%roboCommand%" %args%
)
call "%base%vendor\bin\robo" "%roboCommand%" -- %args% call "%base%vendor\bin\robo" "%roboCommand%" -- %args%