Changeset 14090 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/rebuild-zip.php
- Timestamp:
- 10/03/2024 02:23:43 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/rebuild-zip.php
r8482 r14090 17 17 // Guess the default parameters: 18 18 if ( empty( $opts ) && $argc == 2 ) { 19 $opts['plugin'] = $argv[1]; 20 $argv[1] = '--plugin ' . $argv[1]; 19 if ( preg_match( '#^https?://downloads.w(ordpress)?.org/plugin/(?P<slug>[a-z0-9-]+)(\.(?P<version>.+))?\.zip$#', $argv[1], $m ) ) { 20 21 $opts['plugin'] = $m['slug']; 22 $argv[1] = '--plugin ' . $m['slug']; 23 24 $opts['versions'] = $m['version'] ?: 'trunk'; 25 $argv[2] = '--versions ' . $opts['versions']; 26 } else { 27 $opts['plugin'] = $argv[1]; 28 $argv[1] = '--plugin ' . $argv[1]; 29 } 21 30 } 22 31 if ( empty( $opts ) && $argc == 3 ) { … … 40 49 if ( empty( $opts[ $opt ] ) ) { 41 50 fwrite( STDERR, "Missing Parameter: $opt\n" ); 42 fwrite( STDERR, "Usage: php {$argv[0]} --plugin hello-dolly --versions 1.0,trunk --abspath /home/example/public_html --url https://wordpress.org/plugins/\n" ); 51 fwrite( STDERR, "Usage: \n" ); 52 fwrite( STDERR, "\tphp {$argv[0]} --plugin hello-dolly --versions 1.0,trunk\n" ); 53 fwrite( STDERR, "\tphp {$argv[0]} https://downloads.wordpress.org/plugin/hello-dolly.1.0.zip\n" ); 54 fwrite( STDERR, "\tphp {$argv[0]} --plugin hello-dolly --versions 1.0,trunk --abspath /home/example/public_html --url https://wordpress.org/plugins/\n" ); 43 55 fwrite( STDERR, "--url and --abspath will be guessed if possible.\n" ); 44 56 fwrite( STDERR, "--versions if skipped will rebuild all tags/trunk.\n" );
Note: See TracChangeset
for help on using the changeset viewer.