-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate-profile.sh
executable file
·129 lines (96 loc) · 3.42 KB
/
create-profile.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# author: Dut Andrew Kulang dutandrewkulang[at]gmail.com
#!/bin/bash
#image link
IMAGELINK='assets/images/profiles/'
profiles_home_path='_profiles/'
echo $'Enter full eg. Dut Andrew Kulang: '
read F_NAME
# removing extra unnecessary spaces in the string.
F_NAME=$(echo "$F_NAME" | tr -s ' ')
# name separeted by dashes to be create image and markdown files 'Dut-Andrew-Kulang/' 'Dut-Andrew-Kulang.md'
D_NAME="${F_NAME//' '/'-'}"
# Image directory
IMAGE_DIR=$IMAGELINK$D_NAME
# the path to a profile among other profiles
path_to_profile=$profiles_home_path$D_NAME.md
if [ ! -f "$path_to_profile" ]
then
read -p $'Hub/organization\n' HUB
HUB=$(echo "$HUB" | tr -s ' ')
read -p $'Languages Eg: English (Very Good), Dinka (Native), French (Basic)\n' LANGUAGES
LANGUAGES=$(echo "$LANGUAGES" | tr -s ' ')
read -p $'In which country are you active in?\n' COUNTRY
COUNTRY=$(echo "$COUNTRY" | tr -s ' ')
echo -e $"In region/district/state of $COUNTRY are you operate in?"
read REGION
REGION=$(echo "$REGION" | tr -s ' ')
read -p $'E-mail\n' EMAIL
EMAIL=$(echo "$EMAIL" | tr -s ' ')
read -p $'Your phone number e.g. +256782....\n' PHONE_NUMBER
PHONE_NUMBER=$(echo "$PHONE_NUMBER" | tr -s ' ')
read -p $'Whatsapp Number e.g +2119..\n' WHATSAPP_NUMBER
WHATSAPP_NUMBER=$(echo "$WHATSAPP_NUMBER" | tr -s ' ')
read -p $'Website URL e.g https://lead.asknet.community\n' WEBSITE_URL
read -p $'Telegram username e.g Username\n' TELEGRAM
TELEGRAM=$(echo "$TELEGRAM" | tr -s ' ')
read -p $'GitHub Username e.g Username\n' GITHUB
GITHUB=$(echo "$GITHUB" | tr -s ' ')
read -p $'URL to LinkedIn profile Username\n' LINKEDIN
LINKEDIN=$(echo "$LINKEDIN" | tr -s ' ')
read -p $'Your twitter Username\n' TWITTER
TWITTER=$(echo "$TWITTER" | tr -s ' ')
read -p $'Your Facebook Username\n' FACEBOOK
FACEBOOK=$(echo "$FACEBOOK" | tr -s ' ')
read -p $'Your instagram Username\n' INSTAGRAM
INSTAGRAM=$(echo "$INSTAGRAM" | tr -s ' ')
read -p $'Mastodon profile link\n' MASTODON
MASTODON=$(echo "$MASTODON" | tr -s ' ')
read -p $'Your wikifab Username\n' WIKIFAB
WIKIFAB=$(echo "$WIKIFAB" | tr -s ' ')
read -p $'Other\n' OTHER
OTHER=$(echo "$OTHER" | tr -s ' ')
read -d "@" -p $'Profile bio, Type @ at the end to continue\n' BIO
BIO=$(echo "$BIO" | tr -s ' ')
#check if the expert already has an image directory
if [ -d "$IMAGE_DIR" ]
then
echo "\n$F_NAME already has a image folder at $IMAGE_DIR"
else
mkdir -p $IMAGE_DIR
echo "\nImage folder created for $F_NAME at $IMAGE_DIR"
fi
if [ ! -d "$profiles_home_path" ]
then
#profile path
mkdir -p _profiles
fi
echo "---
layout: profile
title: \"$F_NAME\"
image: \"$IMAGELINK$D_NAME/$D_NAME\"
country: $COUNTRY
region: $REGION
hub: $HUB
languages: $LANGUAGES
mail: $EMAIL
phone: \"$PHONE_NUMBER\"
whatsapp: \"$WHATSAPP_NUMBER\"
website: $WEBSITE_URL
telegram: $TELEGRAM
github: $GITHUB
linkedin: $LINKEDIN
twitter: $TWITTER
facebook: $FACEBOOK
instagram: $INSTAGRAM
mastodon: $MASTODON
wikifab: $WIKIFAB
skills:
- { name: '' , number: 1, qualification: \"\"}
- { name: '' , number: 2, qualification: \"\"}
- { name: '' , number: 3, qualification: \"\"}
- { name: '' , number: 4, qualification: \"\"}
---
$BIO" | tee > $path_to_profile
else
echo "\n$F_NAME already has a profile file at $path_to_profile."
fi