Skip to content

Commit

Permalink
Merge pull request #83 from TheDragonCode/2.x
Browse files Browse the repository at this point in the history
Added filling in permission keys to launch plugins
  • Loading branch information
Andrey Helldar committed Jun 16, 2022
2 parents cb7479e + 1890ed0 commit 915fb64
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -8,7 +8,7 @@ ARG INPUT_EDITORCONFIG
ARG INPUT_DEPENDABOT
ARG INPUT_NORMALIZE

RUN composer global require dragon-code/codestyler:^2.0
RUN composer global require dragon-code/codestyler:^2.1

COPY shell /shell
COPY entrypoint.sh /entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion bin/codestyle
Expand Up @@ -39,8 +39,8 @@ require_once $file;
$application = new Application('The Dragon Code Styler');

$application->add(new Check());
$application->add(new Fix());
$application->add(new Dependabot());
$application->add(new EditorConfig());
$application->add(new Fix());

$application->run();
1 change: 1 addition & 0 deletions entrypoint.sh
Expand Up @@ -2,6 +2,7 @@

source /shell/functions.sh
source /shell/config.sh
source /shell/plugins.sh

source /shell/check.sh
source /shell/fix.sh
Expand Down
2 changes: 0 additions & 2 deletions shell/normalize.sh
Expand Up @@ -7,8 +7,6 @@ if [[ $(allow "$INPUT_NORMALIZE") == "true" ]]; then
if [[ -f "./composer.json" ]]; then
IS_DIRTY_NORMALIZE=1

composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true

{ composer normalize --ansi && git add . && git commit -a -m "Normalize \`composer.json\` 👀"; } || IS_DIRTY_NORMALIZE=0
fi
fi
13 changes: 13 additions & 0 deletions shell/plugins.sh
@@ -0,0 +1,13 @@
#!/bin/sh -l

IS_PLUGINS_CONFIG=1

composer global config --no-plugins allow-plugins.dragon-code/codestyler true
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer global config --no-plugins allow-plugins.friendsofphp/php-cs-fixer true

composer config --no-plugins allow-plugins.dragon-code/codestyler true
composer config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer config --no-plugins allow-plugins.friendsofphp/php-cs-fixer true

{ git add . && git commit -a -m "Updated permissions to run plugins 🦾"; } || IS_PLUGINS_CONFIG=0
2 changes: 1 addition & 1 deletion shell/push.sh
Expand Up @@ -3,7 +3,7 @@
function isDirty() {
local result="false"

if [[ "$IS_DIRTY_DEPENDABOT" == "1" || "$IS_DIRTY_EDITORCONFIG" == "1" || "$IS_DIRTY_CODE" == "1" || "$IS_DIRTY_NORMALIZE" == "1" ]]; then
if [[ "$IS_DIRTY_DEPENDABOT" == "1" || "$IS_DIRTY_EDITORCONFIG" == "1" || "$IS_DIRTY_CODE" == "1" || "$IS_DIRTY_NORMALIZE" == "1" || "$IS_PLUGINS_CONFIG" == "1" ]]; then
result="true"
fi

Expand Down

0 comments on commit 915fb64

Please sign in to comment.