Skip to content

Commit

Permalink
awk ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Aug 11, 2016
1 parent 42ea40d commit a003bb9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Yep/Extensions/UIImage+Yep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extension UIImage {

// nix love awk, in Images.xcassets
// $ ls -l | awk '{print $9}' | awk -F"." '{print $1}' | awk -F"_" '{out=$0" ";for(i=1;i<=NF;i++){if(i==1){out=out""tolower($i)}else{out=out""toupper(substr($i,1,1))substr($i,2)}};print out}' | awk '{print "static var yep_"$2": UIImage {\n\treturn UIImage(named: \""$1"\")!\n}\n"}' > ~/Downloads/images.swift
// ref https://github.com/nixzhu/dev-blog/blob/master/2016-08-11-awk.md

extension UIImage {

Expand Down

0 comments on commit a003bb9

Please sign in to comment.