This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better talking yeti, more verbose install process
- Loading branch information
Geoff Kimball
committed
Dec 3, 2014
1 parent
2966400
commit 4e4ea59
Showing
4 changed files
with
130 additions
and
63 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,15 @@ | ||
#!/usr/bin/env node | ||
|
||
// /| | ||
// | | /| . | ||
// . /\| \/ |/| | ||
// |\/ | | ||
// ||\__/\____/|| | ||
// ___|| ======== ||___ | ||
// /___|| O O ||___\ | ||
// || ______, || | ||
// /| |\ | ||
// /_/\\/\ /\//\_\ | ||
// \/\\//\/ | ||
// \/ | ||
|
||
var colors = require('colors'); | ||
|
||
var yeti = [ | ||
'\n /|' | ||
, '\n | | /| .' | ||
, '\n . /\\| \\/ |/|' | ||
, '\n |\\/ |' | ||
, '\n |'+'|\\__/\\____/|'.cyan+'|' | ||
, '\n '+'___'.gray+'|'+'|'.cyan+' '+'========'.gray+' '+'|'.cyan+'|'+'___'.gray | ||
, '\n '+'/___'.gray+'|'+'|'.cyan+' '+'O'.cyan+' '+'O'.cyan+' ||'+'___\\'.gray | ||
, '\n |'+'|'.cyan+' '+'______,'.cyan+' '+'|'.cyan+'|' | ||
, '\n /'+'|'.cyan+' '+'|'.cyan+'\\ ' | ||
, '\n /_/\\'+'\\/\\'.cyan+' '+'/\\/'.cyan+'/\\_\\ ' | ||
, '\n \\/\\'+'\\/'.cyan+'/\\/' | ||
, '\n \\/' | ||
, '\n' | ||
]; | ||
|
||
yeti[3] = yeti[3] + ' '+'Thanks for installing Foundation for Apps!'; | ||
yeti[4] = yeti[4] + ' ------------------------------------------'; | ||
yeti[5] = yeti[5] + ' Type '+'foundation-apps new app'.cyan+' to create a new app,'; | ||
yeti[6] = yeti[6] + ' or '+'foundation-apps help'.cyan+' to see every command.'; | ||
yeti[8] = yeti[8] + ' '+'@zurbfoundation'.cyan+' on Twitter'; | ||
|
||
console.log(yeti.join('')); | ||
var yeti = require('./yeti'); | ||
|
||
var msg = [ | ||
'Thanks for installing Foundation for Apps!', | ||
'------------------------------------------', | ||
'Type ' + 'foundation-apps new app'.cyan+' to create a new app,', | ||
'or '+'foundation-apps help'.cyan+' to see every command.', | ||
'', | ||
'We\'re '+'@zurbfoundation'.cyan+' on Twitter.', | ||
] | ||
|
||
yeti(msg); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// /| | ||
// | | /| . | ||
// . /\| \/ |/| | ||
// |\/ | | ||
// ||\__/\____/|| | ||
// ___|| ======== ||___ | ||
// /___|| O O ||___\ | ||
// || ______, || | ||
// /| |\ | ||
// /_/\\/\ /\//\_\ | ||
// \/\\//\/ | ||
// \/ | ||
|
||
var colors = require('colors') | ||
, stringLength = require('string-length') | ||
; | ||
|
||
var yeti = [ | ||
'\n /|' | ||
, '\n | | /| .' | ||
, '\n . /\\| \\/ |/|' | ||
, '\n |\\/ |' | ||
, '\n |'+'|\\__/\\____/|'.cyan+'|' | ||
, '\n '+'___'.gray+'|'+'|'.cyan+' '+'========'.gray+' '+'|'.cyan+'|'+'___'.gray | ||
, '\n '+'/___'.gray+'|'+'|'.cyan+' '+'O'.cyan+' '+'O'.cyan+' ||'+'___\\'.gray | ||
, '\n |'+'|'.cyan+' '+'______,'.cyan+' '+'|'.cyan+'|' | ||
, '\n /'+'|'.cyan+' '+'|'.cyan+'\\ ' | ||
, '\n /_/\\'+'\\/\\'.cyan+' '+'/\\/'.cyan+'/\\_\\ ' | ||
, '\n \\/\\'+'\\/'.cyan+'/\\/' | ||
, '\n \\/' | ||
, '\n' | ||
]; | ||
|
||
var baseTextOffset = 5 | ||
, longestLine = (function() { | ||
var highest = 0; | ||
for (var i = 0; i < yeti.length; i++) { | ||
var len = stringLength(yeti[i]); | ||
if (len > highest) highest = len; | ||
} | ||
return highest; | ||
})(); | ||
|
||
// Thank you: http://stackoverflow.com/a/5450113/492553 | ||
var repeatChar = function(pattern, count) { | ||
if (count < 1) return ''; | ||
var result = ''; | ||
while (count > 1) { | ||
if (count & 1) result += pattern; | ||
count >>= 1, pattern += pattern; | ||
} | ||
return result + pattern; | ||
} | ||
|
||
// This function takes an array of text messages and places them next to the ASCII yeti | ||
module.exports = function(text) { | ||
var yetiHeight = yeti.length - 1 | ||
, textHeight = text.length | ||
, textOffset = Math.floor((yetiHeight - textHeight) / 2) | ||
, yetiMsg = yeti | ||
; | ||
|
||
for (var i = 0; i < text.length; i++) { | ||
var offset = textOffset + i; | ||
var spaceCount = longestLine - stringLength(yetiMsg[offset]) + baseTextOffset; | ||
yetiMsg[offset] = yetiMsg[offset] + repeatChar(' ', spaceCount) + text[i]; | ||
} | ||
|
||
console.log(yetiMsg.join('')); | ||
} |
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