1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Rewrite os in shell

This commit is contained in:
Daniel Barber 2023-01-23 17:45:23 -06:00
parent 93f6e94d77
commit 766726309e
2 changed files with 15 additions and 24 deletions

View File

@ -1,21 +0,0 @@
class OS
ICONS = {
"Darwin" => "",
"Linux" => "",
"FreeBSD" => "",
}
def os
"#{icon} #{name}"
end
private
def name
@os ||= `uname -s`.strip
end
def icon
ICONS[name]
end
end

18
bin/os
View File

@ -1,5 +1,17 @@
#!/usr/bin/env ruby
#!/bin/sh
require_relative "lib/os"
OS=`uname -s`
puts OS.new.os
case $OS in
Darwin)
printf ""
;;
Linux)
printf ""
;;
FreeBSD)
printf ""
;;
esac
printf " $OS\n"