Skip to content

Instantly share code, notes, and snippets.

@mattrothenberg
Created February 2, 2017 20:41
Show Gist options
  • Save mattrothenberg/6c9f1d87606eb86702dfdcc083f80035 to your computer and use it in GitHub Desktop.
Save mattrothenberg/6c9f1d87606eb86702dfdcc083f80035 to your computer and use it in GitHub Desktop.
Runway CLI Step #2
#!/usr/bin/env node
var program = require('commander');
program
.command('new-styleguide <stylesheet>')
.description('Creates a new Runway styleguide, given a .CSS or .SCSS file. Returns the URL to your styleguide.')
.action(newStyleguide);
function generateRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
function newStyleguide(cmd) {
var randomStyleguideId = generateRandomNumber(1000, 2000);
console.log(`http://runway-app.cfapps.io/styleguide/${randomStyleguideId}`);
}
program.parse(process.argv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment