Opened 7 years ago
Closed 7 years ago
#41957 closed defect (bug) (fixed)
Fix Grunt tasks to run without needing access to svn or git
Reported by: | azaozz | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Build/Test Tools | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In the Grunt config we (cleverly) test which files were modified before running the precommit
task to save some time and not process and test unmodified files.
However in some cases the svn
or git
commands may not be globally accessible in the terminal. This usually happens when they are installed as part of larger packages like IDEs, GUIs, etc.
In these cases we exit with an error but we can still perform all building and testing tasks.
Attachments (2)
Change History (9)
#2
in reply to:
↑ description
;
follow-up:
↓ 3
@
7 years ago
#3
in reply to:
↑ 2
@
7 years ago
Replying to netweb:
Yep, with the patch when there is no .svn or .git dir Grunt still throws the fatal.
I'm thinking rather than Grunt throw a fatal in the first place we should add support to have a more generic fallback...
Sounds good.
#5
follow-up:
↓ 6
@
7 years ago
- Keywords commit added
I'm not able to test this until next week (on holidays for a week) but visually it looks good to me @azaozz :)
Replying to azaozz:
In testing this I also thought of the scenario where a zip file of the WordPress devlop repo is downloaded and extracted to a folder, this could be either:
As such there is no
.git
or.svn
folders yet thegit
andsvn
commands may still be available and runninggrunt precommit
from the terminal Grunt throws afatal
and exits:grunt.fatal( 'This WordPress install is not under version control.' );
( Gruntfile.js#L864 )@azaozz I'm guessing this still occurs in the environment you've tested with using the 41957.patch and that the Grunt fatal is suppressed though and not seen, as such your patch then allows
precommit
to continue.I'm thinking rather than Grunt throw a fatal in the first place we should add support to have a more generic fallback for when neither the Git or SVN folders or commands are available to then as you propose to run the full
grunt precommit
suite of tasks?