WeareJH / wf2

PHP environments for Magento 1, Magento 2 & Wordpress
6 stars 3 forks source link

Show a diff when app/etc/env.php.dist has changed from app/etc/env.php #87

Closed AydinHassan closed 4 years ago

AydinHassan commented 4 years ago

When running wf up sometimes a message is displayed mentioning the following:

[wf2 info]: using wf2.yml
[wf2 info]: Your local app/etc/env.php doesn't match app/etc/env.php.dist, override? Y/n

I mostly ignore it because I can't be bothered to find out what changed and worry that I will inadvertently break my setup by unconsciously importing the new file.

So purely for my laziness (and ofc for our other friendly lazy devs) it would be nice to have the option to display what changed and then we can make a decision then and there.

git --no-pager  diff --no-index app/etc/env.php.dist app/etc/env.php
AydinHassan commented 4 years ago

We can also reduce the context with -U0

git --no-pager  diff --no-index app/etc/env.php.dist app/etc/env.php
diff --git a/app/etc/env.php.dist b/app/etc/env.php
index a463262..928b506 100644
--- a/app/etc/env.php.dist
+++ b/app/etc/env.php
@@ -120,9 +120,6 @@ return [
                 ],
                 'default' => [
                     'front' => 'cms'
-                ],
-                'cookie' => [
-                    'cookie_domain' => 'salons.m2'
                 ]
             ],
             'admin' => [

vs

git --no-pager  diff --no-index app/etc/env.php.dist app/etc/env.php -U0
diff --git a/app/etc/env.php.dist b/app/etc/env.php
index a463262..928b506 100644
--- a/app/etc/env.php.dist
+++ b/app/etc/env.php
@@ -123,3 +122,0 @@ return [
-                ],
-                'cookie' => [
-                    'cookie_domain' => 'salons.m2'
AydinHassan commented 4 years ago

I'd probably cut the first 4 lines as well, we know which file it is, since it's the same always.