[wp-trac] [WordPress Trac] #41957: Fix Grunt tasks to run without needing access to svn or git

WordPress Trac noreply at wordpress.org
Sat Sep 23 04:42:12 UTC 2017


#41957: Fix Grunt tasks to run without needing access to svn or git
------------------------------+--------------------
 Reporter:  azaozz            |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  4.9
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+--------------------

Comment (by netweb):

 Replying to [ticket:41957 azaozz]:
 > 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 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:

 * GitHub Mirror: https://github.com/WordPress/wordpress-
 develop/archive/master.zip
 * SVN:
 https://core.trac.wordpress.org/changeset/41574/trunk?old_path=%2F&format=zip

 As such there is no `.git` or `.svn` folders yet the `git` and `svn`
 commands ''may'' still be available and running `grunt precommit` from the
 terminal Grunt throws a `fatal` and exits:

 * `grunt.fatal( 'This WordPress install is not under version control.' );`
 ( [https://core.trac.wordpress.org/browser/trunk/Gruntfile.js#L864
 Gruntfile.js#L864] )

 @azaozz I'm guessing this still occurs in the environment you've tested
 with using the [attachment: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?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41957#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list