Merge remote-tracking branch 'youngjin/master'

This commit is contained in:
Nico Schottelius 2020-05-11 12:27:45 +02:00
commit 59820d2861
6 changed files with 51 additions and 0 deletions

View file

@ -4,6 +4,12 @@ case "$__target_host" in
localhost)
__motd
__timezone Asia/Seoul
# __my_computer
__colourful_file --colour yellow
;;
jafo.laptop)
__motd
__timezone Asia/Seoul
__my_computer
;;
esac

View file

@ -0,0 +1,9 @@
colour=\
yellow\
black\
white\
grey\
puple\
green\
red\
blue

View file

@ -0,0 +1,14 @@
#!/bin/sh -e
__file ~/colourful
printf "colour=" > ~/colourful
# parameter with multiple values
if [ -f "$__object/parameter/colour" ]; then
colour="$(cat "$__object/parameter/colour")"
echo $colour >> ~/colourful
# for alias in $(cat "$__object/parameter/colour"); do
# echo $alias >> ~/colourful
# done
fi

View file

@ -0,0 +1 @@
colour

View file

@ -1,3 +1,24 @@
* 2020-05-08
*** cdist #3: type parameters
**** Lecture content
***** TODO Create a new type named *__colourful_file*
****** TODO The objective is to create a type that creates colourful file
****** TODO The content of the file should be "colour=...", where "..." is a colour specified by a parameter
****** TODO Add an *optional parameter* named *colour*
****** TODO Use the **__file** type inside your type to create a file
****** TODO Use the *$__object_id* variable inside your type
***** TODO Extend your type to be more colourful
****** TODO Modify the *optional parameter* to be able to be specified *multiple times*
****** TODO For each time it is specified, add a line "colour=..." to the file
***** TODO Create a new type *__my_dotfiles*
****** TODO Objective is to manage the dotfiles in your home directory
****** TODO Make it a *singleton* type
****** TODO Create a sub directory *files* in the type
****** TODO Add your .emacs config to the files folder
****** TODO Add a *for* loop to your type to deploy .[A-z]* to your home directory
****** TODO Add a .bashrc or .zshrc to the files folder (depending on your shell)
****** TODO In the initial manifest, add __my_dotfiles when the target host is localhost
***** TODO As usual commit all changes to your ungleich-learning-circle repo
* 2020-05-06
** cdist #2: Your first cdist type
**** Lecture content