Browse Source

refactor(install): simplify install messages

Josh Habdas 1 year ago
parent
commit
b5df9eba28
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 7 additions and 13 deletions
  1. 7
    13
      bin/install

+ 7
- 13
bin/install View File

@@ -21,38 +21,35 @@ create_site_dir () {
21 21
    fi
22 22
 
23 23
    SITE_DIR_ABS="$PWD/$SITE_DIR"
24
-
25
-   echo "Creating directory $SITE_DIR_ABS"
26 24
    mkdir -p "$SITE_DIR"
27 25
 }
28 26
 
29 27
 create_site () {
30
-   echo "Creating a new Hugo site ..."
28
+   echo "Creating a new Hugo site in $SITE_DIR ..."
31 29
    hugo new site "$SITE_DIR" 1>/dev/null
32 30
    cd "$SITE_DIR" || exit 1
33 31
 }
34 32
 
35 33
 download_theme () {
36
-   echo "Downloading the latest version of the After Dark theme ..."
34
+   echo "Downloading the latest version of After Dark ..."
37 35
    meta=$(wget -qO - https://registry.npmjs.org/after-dark/latest)
38 36
    vers=$(echo "$meta" | egrep -o "\"version\".*[^,]*," | cut -d ',' -f1 | cut -d ':' -f2 | tr -d '" ')
39 37
    mkdir -p themes/after-dark
40 38
    wget -qO - https://registry.npmjs.org/after-dark/-/after-dark-"$vers".tgz | tar --strip-components=1 -xz -C themes/after-dark
41
-   echo "Theme version $vers downloaded to $SITE_DIR/themes/after-dark"
39
+   echo "Version $vers downloaded to $SITE_DIR/themes/after-dark"
42 40
 }
43 41
 
44 42
 download_module () {
45 43
    [ -z "$1" ] && { echo "Error: Attempt to download undefined module" >&2; exit 1; }
46
-   echo "Downloading $1 module for After Dark theme ..."
44
+   echo "Downloading $1 module for After Dark ..."
47 45
    meta=$(wget -qO - https://registry.npmjs.org/"$1"/latest)
48 46
    vers=$(echo "$meta" | egrep -o "\"version\".*[^,]*," | cut -d ',' -f1 | cut -d ':' -f2 | tr -d '" ')
49 47
    mkdir -p themes/"$1"
50 48
    wget -qO - https://registry.npmjs.org/"$1"/-/"$1"-"$vers".tgz | tar --strip-components=1 -xz -C themes/"$1"
51
-   echo "Module version $vers downloaded to $SITE_DIR/themes/$1"
49
+   echo "Version $vers downloaded to $SITE_DIR/themes/$1"
52 50
 }
53 51
 
54 52
 configure_theme () {
55
-   # Provide basic configuration and ignore generated files
56 53
    echo "Configuring basic After Dark theme settings ..."
57 54
    tee "config.toml" > /dev/null <<TOML
58 55
 baseurl = "https://domain.example/" # Controls base URL sitewide
@@ -103,7 +100,7 @@ create_example_post () {
103 100
 }
104 101
 
105 102
 serve_site_locally () {
106
-   echo "Serving your site at http://0.0.0.0:1313/"
103
+   echo "Serving your content locally ..."
107 104
    hugo serve --buildExpired --port 1313 --bind "0.0.0.0" 1>/dev/null &
108 105
 }
109 106
 
@@ -120,12 +117,9 @@ create_example_post
120 117
 serve_site_locally
121 118
 
122 119
 echo "Installation completed successfully!"
123
-echo "Your new site was created in $SITE_DIR_ABS."
120
+echo "Site created in $SITE_DIR_ABS"
124 121
 echo "Navigate to http://0.0.0.0:1313/ to view it now."
125 122
 echo "Run 'kill $(ps aux | awk '/[h]ugo.*1313/ {print $2}')' to stop it."
126 123
 echo "Run 'cd $SITE_DIR && hugo serve --buildDrafts' to start it again."
127 124
 echo "Run 'hugo serve --buildExpired' to view the online help."
128 125
 echo "Thank you for choosing After Dark."
129
-
130
-# Stop web server if it's still running backgrounded
131
-# kill $(ps aux | awk '/[h]ugo.*1313/ {print $2}') 2>/dev/null

Loading…
Cancel
Save