Learning Circle : cdist #3 initial commit

This commit is contained in:
youngjin.han 2020-05-09 00:25:57 +09:00
parent 27f6d6dd6e
commit 44f72d34f8
5 changed files with 45 additions and 0 deletions

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