Compare commits
2 Commits
875be9645e
...
920faf284d
Author | SHA1 | Date | |
---|---|---|---|
920faf284d | |||
c01cbe5914 |
12
~/Bash/command_exists.sh
Normal file
12
~/Bash/command_exists.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
echo 'Error: git is not installed.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v crystal &> /dev/null
|
||||
then
|
||||
echo "<the_command> could not be found"
|
||||
exit
|
||||
fi
|
24
~/Crystal/Colorize.cr
Normal file
24
~/Crystal/Colorize.cr
Normal file
@ -0,0 +1,24 @@
|
||||
require "colorize"
|
||||
|
||||
"foo".colorize(:green)
|
||||
100.colorize(:red)
|
||||
[1, 2, 3].colorize(:blue)
|
||||
|
||||
# Available colors are:
|
||||
# :default
|
||||
# :black
|
||||
# :red
|
||||
# :green
|
||||
# :yellow
|
||||
# :blue
|
||||
# :magenta
|
||||
# :cyan
|
||||
# :light_gray
|
||||
# :dark_gray
|
||||
# :light_red
|
||||
# :light_green
|
||||
# :light_yellow
|
||||
# :light_blue
|
||||
# :light_magenta
|
||||
# :light_cyan
|
||||
# :white
|
@ -4,3 +4,4 @@
|
||||
- [Значение из Regex::MatchData](value_from_match.cr) - Получить значение из `Regex::MatchData("Happy")`
|
||||
- [IO::TimeoutError](prompt_timeout.cr) - Установка тайм-аута на пользовательский ввод
|
||||
- [ENV["..."]](env_variable.cr) - Переменные среды
|
||||
- [Colorize](Colorize.cr) - Цветной вывод в консоль
|
||||
|
Loading…
Reference in New Issue
Block a user