Skip to content
Permalink
Browse files

Merge branch 't/11167'

  • Loading branch information...
oleq committed Nov 15, 2013
2 parents 647adc6 + bc251da commit 615d1e17240e0b5981cdf111a3273ff23d275c6a
Showing with 218 additions and 8,463 deletions.
  1. +1 −0 .gitignore
  2. +0 −89 dev/iconmaker/bin/iconmaker.js
  3. +89 −0 dev/iconmaker/iconmaker.js
  4. +112 −112 dev/iconmaker/lib/main.js
  5. +0 −4 dev/iconmaker/node_modules/optimist/.travis.yml
  6. +0 −21 dev/iconmaker/node_modules/optimist/LICENSE
  7. +0 −10 dev/iconmaker/node_modules/optimist/example/bool.js
  8. +0 −7 dev/iconmaker/node_modules/optimist/example/boolean_double.js
  9. +0 −7 dev/iconmaker/node_modules/optimist/example/boolean_single.js
  10. +0 −8 dev/iconmaker/node_modules/optimist/example/default_hash.js
  11. +0 −7 dev/iconmaker/node_modules/optimist/example/default_singles.js
  12. +0 −8 dev/iconmaker/node_modules/optimist/example/divide.js
  13. +0 −20 dev/iconmaker/node_modules/optimist/example/line_count.js
  14. +0 −29 dev/iconmaker/node_modules/optimist/example/line_count_options.js
  15. +0 −29 dev/iconmaker/node_modules/optimist/example/line_count_wrap.js
  16. +0 −4 dev/iconmaker/node_modules/optimist/example/nonopt.js
  17. +0 −2 dev/iconmaker/node_modules/optimist/example/reflect.js
  18. +0 −3 dev/iconmaker/node_modules/optimist/example/short.js
  19. +0 −11 dev/iconmaker/node_modules/optimist/example/string.js
  20. +0 −19 dev/iconmaker/node_modules/optimist/example/usage-options.js
  21. +0 −10 dev/iconmaker/node_modules/optimist/example/xup.js
  22. +0 −498 dev/iconmaker/node_modules/optimist/index.js
  23. +0 −1 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/.npmignore
  24. +0 −70 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/README.markdown
  25. +0 −10 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/example/center.js
  26. +0 −3 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/example/meat.js
  27. +0 −76 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/index.js
  28. +0 −44 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/package.json
  29. +0 −30 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/test/break.js
  30. +0 −63 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
  31. +0 −31 dev/iconmaker/node_modules/optimist/node_modules/wordwrap/test/wrap.js
  32. +0 −49 dev/iconmaker/node_modules/optimist/package.json
  33. +0 −500 dev/iconmaker/node_modules/optimist/readme.markdown
  34. +0 −71 dev/iconmaker/node_modules/optimist/test/_.js
  35. +0 −2 dev/iconmaker/node_modules/optimist/test/_/argv.js
  36. +0 −3 dev/iconmaker/node_modules/optimist/test/_/bin.js
  37. +0 −31 dev/iconmaker/node_modules/optimist/test/dash.js
  38. +0 −446 dev/iconmaker/node_modules/optimist/test/parse.js
  39. +0 −14 dev/iconmaker/node_modules/optimist/test/parse_modified.js
  40. +0 −16 dev/iconmaker/node_modules/optimist/test/short.js
  41. +0 −292 dev/iconmaker/node_modules/optimist/test/usage.js
  42. +0 −8 dev/iconmaker/node_modules/optimist/test/whitespace.js
  43. +0 −33 dev/iconmaker/node_modules/png-js/README.md
  44. BIN dev/iconmaker/node_modules/png-js/images/ball.png
  45. BIN dev/iconmaker/node_modules/png-js/images/broken.png
  46. BIN dev/iconmaker/node_modules/png-js/images/chompy.png
  47. BIN dev/iconmaker/node_modules/png-js/images/djay-indexed.png
  48. BIN dev/iconmaker/node_modules/png-js/images/djay.png
  49. BIN dev/iconmaker/node_modules/png-js/images/laptop.png
  50. BIN dev/iconmaker/node_modules/png-js/images/loading.png
  51. BIN dev/iconmaker/node_modules/png-js/images/spinfox.png
  52. BIN dev/iconmaker/node_modules/png-js/images/trees.png
  53. +0 −34 dev/iconmaker/node_modules/png-js/index.html
  54. +0 −35 dev/iconmaker/node_modules/png-js/package.json
  55. +0 −264 dev/iconmaker/node_modules/png-js/png-node.coffee
  56. +0 −317 dev/iconmaker/node_modules/png-js/png-node.js
  57. +0 −388 dev/iconmaker/node_modules/png-js/png.coffee
  58. +0 −458 dev/iconmaker/node_modules/png-js/png.js
  59. +0 −464 dev/iconmaker/node_modules/png-js/zlib.js
  60. +0 −40 dev/iconmaker/node_modules/q/CONTRIBUTING.md
  61. +0 −19 dev/iconmaker/node_modules/q/LICENSE
  62. +0 −802 dev/iconmaker/node_modules/q/README.md
  63. +0 −93 dev/iconmaker/node_modules/q/package.json
  64. +0 −1,751 dev/iconmaker/node_modules/q/q.js
  65. +0 −35 dev/iconmaker/node_modules/q/queue.js
  66. +0 −1 dev/iconmaker/node_modules/tmp/.npmignore
  67. +0 −5 dev/iconmaker/node_modules/tmp/.travis.yml
  68. +0 −162 dev/iconmaker/node_modules/tmp/README.md
  69. +0 −272 dev/iconmaker/node_modules/tmp/lib/tmp.js
  70. +0 −48 dev/iconmaker/node_modules/tmp/package.json
  71. +0 −6 dev/iconmaker/node_modules/tmp/test-all.sh
  72. +0 −6 dev/iconmaker/node_modules/tmp/test.js
  73. +0 −74 dev/iconmaker/node_modules/tmp/test/base.js
  74. +0 −171 dev/iconmaker/node_modules/tmp/test/dir-test.js
  75. +0 −165 dev/iconmaker/node_modules/tmp/test/file-test.js
  76. +0 −15 dev/iconmaker/node_modules/tmp/test/graceful.js
  77. +0 −11 dev/iconmaker/node_modules/tmp/test/keep.js
  78. +0 −82 dev/iconmaker/node_modules/tmp/test/name-test.js
  79. +0 −32 dev/iconmaker/node_modules/tmp/test/spawn.js
  80. +0 −22 dev/iconmaker/node_modules/tmp/test/unsafe.js
  81. +16 −0 dev/iconmaker/package.json
@@ -0,0 +1 @@
dev/iconmaker/node_modules

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,89 @@
#!/usr/bin/env node

/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/

'use strict';

var path = require( 'path' ),
fs = require( 'fs' ),
argv = require( 'optimist' ).argv,
util = require( 'util' ),
exec = require( 'child_process' ).exec,

// The heart of the application.
main = require( './lib/main' ),
iconmaker = main.iconmaker,

// This is the size of the icon that makes it default, placed in directory/icon.png
// Other sizes are stored under directory/size/icon.png
DEFAULT_SIZE = main.DEFAULT_SIZE,

helpString = util.format( [
'Usage: iconmaker (options) [extra options]\n\n',

'\tThis program slices CKEditor iconsets into individual icons placed in various locations.\n\n',
'\tIconmaker depends on:\n',
'\t\t * Node.js (see: http://nodejs.org/)\n',
'\t\t * ImageMagick\'s command-line tool named convert (see: http://www.imagemagick.org/script/convert.php).\n\n',

'\tSample call (cold run first):\n\n',
'\t\t./dev/iconmaker/iconmaker.js -i skins/moono/dev/icons16.png -l skins/moono/dev/locations.json -c\n\n',

'Options:\n\n',

' -i FILE input PNG file with the iconset\n',
' -l FILE icon location JSON file\n',

'\nExtra options:\n\n',

' -s icon size (%s is default)\n',
' -c cold run (no file is touched)\n',
' -h this message\n'
].join( '' ), DEFAULT_SIZE );

function gracefulFailure( error ) {
console.error( '[!] %s', error.stack ? error.stack : error );
console.error( '[i] Bye bye!' );
process.exit( 1 );
}

// Display help on demand.
if ( argv.h ) {
console.log( helpString );
process.exit( 0 );
}

// Display help if mandatory arguments are missing.
else if ( !( argv.i && argv.l ) ) {
console.log( helpString );
process.exit( 1 );
}

// Check if convert is installed.
exec( 'convert -version', function( error, stdout, stderr ) {
if ( error ) {
gracefulFailure( 'Convert not found in PATH. See http://www.imagemagick.org/ for more help.' );
}
} );

// Check if PNG exist.
try {
fs.statSync( argv.i );
} catch ( error ) {
gracefulFailure( error );
}

// Load locations file.
fs.readFile( argv.l, function( error, locations ) {
if ( error )
gracefulFailure( error );

try {
iconmaker( argv.i, JSON.parse( locations ), argv.s || DEFAULT_SIZE, argv.c );
} catch ( e ) {
gracefulFailure( e );
}
} );
Oops, something went wrong.

0 comments on commit 615d1e1

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.