forked from pulumi/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew-learn-topic.sh
executable file
·46 lines (36 loc) · 1.05 KB
/
new-learn-topic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -o errexit -o pipefail
module=""
topic=""
prompt_for_module_name() {
read -p "Module name (e.g., pulumi-101-aws): " module
if [[ ! -z "$module" && -d "content/learn/${module}" ]]; then
return
fi
echo "Couldn't find a module with that name. Make sure you're using the path as listed under content/learn."
echo
prompt_for_module_name
}
prompt_for_topic_name() {
read -p "Topic name (e.g., basics): " topic
if [ ! -z "$topic" ]; then
hugo new --kind learn/topic "content/learn/${module}/${topic}"
return
fi
echo "Please give the topic a name."
echo
prompt_for_topic_name
}
echo "So, you want to make a new Learn Pulumi topic? Great! 🙌"
echo
echo "Step 1:"
echo "What is the path name of the module you want to write for?"
echo
prompt_for_module_name
echo
echo "Step 2:"
echo "Now give your new topic a URL-friendly name. For example, to
create a new topic under ${module} that'll live at
https://pulumi.com/learn/${module}/basics, type 'basics'."
echo
prompt_for_topic_name