Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WP-CLI command for updating minifier libraries #38

Open
westonruter opened this issue Sep 19, 2013 · 0 comments
Open

Add WP-CLI command for updating minifier libraries #38

westonruter opened this issue Sep 19, 2013 · 0 comments

Comments

@westonruter
Copy link
Contributor

I had been using something like this:

#!/usr/bin/env php
<?php

chdir( __DIR__ . '/../minify' );

$sources = array(
    "JS/ClosureCompiler.php" => "https://raw.github.com/mrclay/minify/master/min/lib/Minify/JS/ClosureCompiler.php",
    "JS/JSMin.php" => "https://raw.github.com/mrclay/minify/master/min/lib/JSMin.php",
    "JS/JSMinPlus.php" => "https://raw.github.com/mrclay/minify/master/min/lib/JSMinPlus.php",
    "CSS/Compressor.php" => "https://raw.github.com/mrclay/minify/master/min/lib/Minify/CSS/Compressor.php",
    "CSS/UriRewriter.php" => "https://raw.github.com/mrclay/minify/master/min/lib/Minify/CSS/UriRewriter.php",
    "CommentPreserver.php" => "https://raw.github.com/mrclay/minify/master/min/lib/Minify/CommentPreserver.php",
);

foreach( $sources as $path => $url ) {
    echo "$path => $url\n";
    $contents = file_get_contents( $url );
    file_put_contents( $path, $contents ) || exit(1);
    system( sprintf( 'git add %s', escapeshellarg( $path ) ) );
}
westonruter added a commit that referenced this issue Sep 19, 2013
This needs to be registered as a WP-CLI commmand. We don't want just anyone invoking this script over HTTP.

See #38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant