Created
February 2, 2017 20:41
-
-
Save mattrothenberg/6c9f1d87606eb86702dfdcc083f80035 to your computer and use it in GitHub Desktop.
Runway CLI Step #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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