vitat-css 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +146 -8
- data/HTML/.DS_Store +0 -0
- data/HTML/Components/Arabescos.html +87 -0
- data/HTML/Components/Buttons.html +105 -0
- data/HTML/Components/Card.html +337 -0
- data/HTML/Components/CardApp.html +201 -0
- data/HTML/Components/Inputs.html +105 -0
- data/HTML/Components/Lista.html +106 -0
- data/HTML/Components/Pagination.html +218 -0
- data/HTML/Components/Pills.html +94 -0
- data/HTML/Components/Revisado.html +163 -0
- data/JS/prism.js +12 -0
- data/bootstrap/scss/_accordion.scss +118 -0
- data/bootstrap/scss/_alert.scss +57 -0
- data/bootstrap/scss/_badge.scss +29 -0
- data/bootstrap/scss/_breadcrumb.scss +28 -0
- data/bootstrap/scss/_button-group.scss +139 -0
- data/bootstrap/scss/_buttons.scss +111 -0
- data/bootstrap/scss/_card.scss +216 -0
- data/bootstrap/scss/_carousel.scss +229 -0
- data/bootstrap/scss/_close.scss +40 -0
- data/bootstrap/scss/_containers.scss +41 -0
- data/bootstrap/scss/_dropdown.scss +240 -0
- data/bootstrap/scss/_forms.scss +9 -0
- data/bootstrap/scss/_functions.scss +302 -0
- data/bootstrap/scss/_grid.scss +33 -0
- data/bootstrap/scss/_helpers.scss +9 -0
- data/bootstrap/scss/_images.scss +42 -0
- data/bootstrap/scss/_list-group.scss +174 -0
- data/bootstrap/scss/_mixins.scss +43 -0
- data/bootstrap/scss/_modal.scss +209 -0
- data/bootstrap/scss/_nav.scss +139 -0
- data/bootstrap/scss/_navbar.scss +335 -0
- data/bootstrap/scss/_offcanvas.scss +83 -0
- data/bootstrap/scss/_pagination.scss +64 -0
- data/bootstrap/scss/_placeholders.scss +51 -0
- data/bootstrap/scss/_popover.scss +158 -0
- data/bootstrap/scss/_progress.scss +48 -0
- data/bootstrap/scss/_reboot.scss +625 -0
- data/bootstrap/scss/_root.scss +54 -0
- data/bootstrap/scss/_spinners.scss +69 -0
- data/bootstrap/scss/_tables.scss +155 -0
- data/bootstrap/scss/_toasts.scss +51 -0
- data/bootstrap/scss/_tooltip.scss +115 -0
- data/bootstrap/scss/_transitions.scss +27 -0
- data/bootstrap/scss/_type.scss +104 -0
- data/bootstrap/scss/_utilities.scss +630 -0
- data/bootstrap/scss/_variables.scss +1641 -0
- data/bootstrap/scss/bootstrap-grid.scss +67 -0
- data/bootstrap/scss/bootstrap-reboot.scss +13 -0
- data/bootstrap/scss/bootstrap-utilities.scss +18 -0
- data/bootstrap/scss/bootstrap.scss +53 -0
- data/bootstrap/scss/forms/_floating-labels.scss +63 -0
- data/bootstrap/scss/forms/_form-check.scss +152 -0
- data/bootstrap/scss/forms/_form-control.scss +219 -0
- data/bootstrap/scss/forms/_form-range.scss +91 -0
- data/bootstrap/scss/forms/_form-select.scss +72 -0
- data/bootstrap/scss/forms/_form-text.scss +11 -0
- data/bootstrap/scss/forms/_input-group.scss +121 -0
- data/bootstrap/scss/forms/_labels.scss +36 -0
- data/bootstrap/scss/forms/_validation.scss +12 -0
- data/bootstrap/scss/helpers/_clearfix.scss +3 -0
- data/bootstrap/scss/helpers/_colored-links.scss +12 -0
- data/bootstrap/scss/helpers/_position.scss +30 -0
- data/bootstrap/scss/helpers/_ratio.scss +26 -0
- data/bootstrap/scss/helpers/_stacks.scss +15 -0
- data/bootstrap/scss/helpers/_stretched-link.scss +15 -0
- data/bootstrap/scss/helpers/_text-truncation.scss +7 -0
- data/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
- data/bootstrap/scss/helpers/_vr.scss +8 -0
- data/bootstrap/scss/mixins/_alert.scss +11 -0
- data/bootstrap/scss/mixins/_backdrop.scss +14 -0
- data/bootstrap/scss/mixins/_border-radius.scss +78 -0
- data/bootstrap/scss/mixins/_box-shadow.scss +18 -0
- data/bootstrap/scss/mixins/_breakpoints.scss +127 -0
- data/bootstrap/scss/mixins/_buttons.scss +133 -0
- data/bootstrap/scss/mixins/_caret.scss +64 -0
- data/bootstrap/scss/mixins/_clearfix.scss +9 -0
- data/bootstrap/scss/mixins/_color-scheme.scss +7 -0
- data/bootstrap/scss/mixins/_container.scss +9 -0
- data/bootstrap/scss/mixins/_deprecate.scss +10 -0
- data/bootstrap/scss/mixins/_forms.scss +144 -0
- data/bootstrap/scss/mixins/_gradients.scss +47 -0
- data/bootstrap/scss/mixins/_grid.scss +151 -0
- data/bootstrap/scss/mixins/_image.scss +16 -0
- data/bootstrap/scss/mixins/_list-group.scss +24 -0
- data/bootstrap/scss/mixins/_lists.scss +7 -0
- data/bootstrap/scss/mixins/_pagination.scss +31 -0
- data/bootstrap/scss/mixins/_reset-text.scss +17 -0
- data/bootstrap/scss/mixins/_resize.scss +6 -0
- data/bootstrap/scss/mixins/_table-variants.scss +21 -0
- data/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- data/bootstrap/scss/mixins/_transition.scss +26 -0
- data/bootstrap/scss/mixins/_utilities.scss +89 -0
- data/bootstrap/scss/mixins/_visually-hidden.scss +29 -0
- data/bootstrap/scss/utilities/_api.scss +47 -0
- data/bootstrap/scss/vendor/_rfs.scss +354 -0
- data/css/.DS_Store +0 -0
- data/css/prism.css +4 -0
- data/css/style.css +6 -0
- data/gulpfile.js +35 -0
- data/img/.DS_Store +0 -0
- data/img/arrow-active.png +0 -0
- data/img/arrow-disable.png +0 -0
- data/img/arrow.png +0 -0
- data/img/close.png +0 -0
- data/img/phone.png +0 -0
- data/img/placeholder.png +0 -0
- data/img/placeholder_avatar.png +0 -0
- data/img/qr-code-loja.png +0 -0
- data/img/store_icon.png +0 -0
- data/index.html +33 -0
- data/install_nvm.sh +425 -0
- data/lib/vitat/css/version.rb +1 -1
- data/package-lock.json +4233 -0
- data/package.json +9 -0
- data/scss/.DS_Store +0 -0
- data/scss/guide/.DS_Store +0 -0
- data/scss/guide/_variables.scss +171 -0
- data/scss/guide/components/_animations.scss +8 -0
- data/scss/guide/components/_typography.scss +157 -0
- data/scss/guide/components/arabescos/arabescos.scss +47 -0
- data/scss/guide/components/buttons/btn.scss +26 -0
- data/scss/guide/components/buttons/btn__large.scss +10 -0
- data/scss/guide/components/buttons/btn__primary.scss +11 -0
- data/scss/guide/components/buttons/btn__secondary.scss +11 -0
- data/scss/guide/components/buttons/btn__tertiary.scss +11 -0
- data/scss/guide/components/cardapp/cardapp.scss +151 -0
- data/scss/guide/components/cards/card.scss +58 -0
- data/scss/guide/components/cards/card__horizontal.scss +35 -0
- data/scss/guide/components/cards/card__horizontal__small.scss +9 -0
- data/scss/guide/components/inputs/_checkbox.scss +45 -0
- data/scss/guide/components/inputs/_text.scss +8 -0
- data/scss/guide/components/lista/lista.scss +31 -0
- data/scss/guide/components/pagination/pagination.scss +81 -0
- data/scss/guide/components/pills/pill.scss +31 -0
- data/scss/guide/components/pills/pill__full.scss +8 -0
- data/scss/guide/components/pills/pill__secundary.scss +8 -0
- data/scss/guide/components/pills/pill__small.scss +8 -0
- data/scss/guide/components/revisado/revisado.scss +52 -0
- data/scss/guide/style.scss +96 -0
- data/vitat-css-0.1.1.gem +0 -0
- data/vitat-css-0.1.2.gem +0 -0
- data/vitat-css.gemspec +1 -1
- metadata +145 -3
data/install_nvm.sh
ADDED
@@ -0,0 +1,425 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
{ # this ensures the entire script is downloaded #
|
4
|
+
|
5
|
+
nvm_has() {
|
6
|
+
type "$1" > /dev/null 2>&1
|
7
|
+
}
|
8
|
+
|
9
|
+
nvm_default_install_dir() {
|
10
|
+
[ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm"
|
11
|
+
}
|
12
|
+
|
13
|
+
nvm_install_dir() {
|
14
|
+
if [ -n "$NVM_DIR" ]; then
|
15
|
+
printf %s "${NVM_DIR}"
|
16
|
+
else
|
17
|
+
nvm_default_install_dir
|
18
|
+
fi
|
19
|
+
}
|
20
|
+
|
21
|
+
nvm_latest_version() {
|
22
|
+
echo "v0.35.0"
|
23
|
+
}
|
24
|
+
|
25
|
+
nvm_profile_is_bash_or_zsh() {
|
26
|
+
local TEST_PROFILE
|
27
|
+
TEST_PROFILE="${1-}"
|
28
|
+
case "${TEST_PROFILE-}" in
|
29
|
+
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc")
|
30
|
+
return
|
31
|
+
;;
|
32
|
+
*)
|
33
|
+
return 1
|
34
|
+
;;
|
35
|
+
esac
|
36
|
+
}
|
37
|
+
|
38
|
+
#
|
39
|
+
# Outputs the location to NVM depending on:
|
40
|
+
# * The availability of $NVM_SOURCE
|
41
|
+
# * The method used ("script" or "git" in the script, defaults to "git")
|
42
|
+
# NVM_SOURCE always takes precedence unless the method is "script-nvm-exec"
|
43
|
+
#
|
44
|
+
nvm_source() {
|
45
|
+
local NVM_METHOD
|
46
|
+
NVM_METHOD="$1"
|
47
|
+
local NVM_SOURCE_URL
|
48
|
+
NVM_SOURCE_URL="$NVM_SOURCE"
|
49
|
+
if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then
|
50
|
+
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm-exec"
|
51
|
+
elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then
|
52
|
+
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/bash_completion"
|
53
|
+
elif [ -z "$NVM_SOURCE_URL" ]; then
|
54
|
+
if [ "_$NVM_METHOD" = "_script" ]; then
|
55
|
+
NVM_SOURCE_URL="https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm.sh"
|
56
|
+
elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then
|
57
|
+
NVM_SOURCE_URL="https://github.com/nvm-sh/nvm.git"
|
58
|
+
else
|
59
|
+
echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD"
|
60
|
+
return 1
|
61
|
+
fi
|
62
|
+
fi
|
63
|
+
echo "$NVM_SOURCE_URL"
|
64
|
+
}
|
65
|
+
|
66
|
+
#
|
67
|
+
# Node.js version to install
|
68
|
+
#
|
69
|
+
nvm_node_version() {
|
70
|
+
echo "$NODE_VERSION"
|
71
|
+
}
|
72
|
+
|
73
|
+
nvm_download() {
|
74
|
+
if nvm_has "curl"; then
|
75
|
+
curl --compressed -q "$@"
|
76
|
+
elif nvm_has "wget"; then
|
77
|
+
# Emulate curl with wget
|
78
|
+
ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \
|
79
|
+
-e 's/-L //' \
|
80
|
+
-e 's/--compressed //' \
|
81
|
+
-e 's/-I /--server-response /' \
|
82
|
+
-e 's/-s /-q /' \
|
83
|
+
-e 's/-o /-O /' \
|
84
|
+
-e 's/-C - /-c /')
|
85
|
+
# shellcheck disable=SC2086
|
86
|
+
eval wget $ARGS
|
87
|
+
fi
|
88
|
+
}
|
89
|
+
|
90
|
+
install_nvm_from_git() {
|
91
|
+
local INSTALL_DIR
|
92
|
+
INSTALL_DIR="$(nvm_install_dir)"
|
93
|
+
|
94
|
+
if [ -d "$INSTALL_DIR/.git" ]; then
|
95
|
+
echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git"
|
96
|
+
command printf '\r=> '
|
97
|
+
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$(nvm_latest_version)" --depth=1 2> /dev/null || {
|
98
|
+
echo >&2 "Failed to update nvm, run 'git fetch' in $INSTALL_DIR yourself."
|
99
|
+
exit 1
|
100
|
+
}
|
101
|
+
else
|
102
|
+
# Cloning to $INSTALL_DIR
|
103
|
+
echo "=> Downloading nvm from git to '$INSTALL_DIR'"
|
104
|
+
command printf '\r=> '
|
105
|
+
mkdir -p "${INSTALL_DIR}"
|
106
|
+
if [ "$(ls -A "${INSTALL_DIR}")" ]; then
|
107
|
+
command git init "${INSTALL_DIR}" || {
|
108
|
+
echo >&2 'Failed to initialize nvm repo. Please report this!'
|
109
|
+
exit 2
|
110
|
+
}
|
111
|
+
command git --git-dir="${INSTALL_DIR}/.git" remote add origin "$(nvm_source)" 2> /dev/null \
|
112
|
+
|| command git --git-dir="${INSTALL_DIR}/.git" remote set-url origin "$(nvm_source)" || {
|
113
|
+
echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!'
|
114
|
+
exit 2
|
115
|
+
}
|
116
|
+
command git --git-dir="${INSTALL_DIR}/.git" fetch origin tag "$(nvm_latest_version)" --depth=1 || {
|
117
|
+
echo >&2 'Failed to fetch origin with tags. Please report this!'
|
118
|
+
exit 2
|
119
|
+
}
|
120
|
+
else
|
121
|
+
command git -c advice.detachedHead=false clone "$(nvm_source)" -b "$(nvm_latest_version)" --depth=1 "${INSTALL_DIR}" || {
|
122
|
+
echo >&2 'Failed to clone nvm repo. Please report this!'
|
123
|
+
exit 2
|
124
|
+
}
|
125
|
+
fi
|
126
|
+
fi
|
127
|
+
command git -c advice.detachedHead=false --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet "$(nvm_latest_version)"
|
128
|
+
if [ -n "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then
|
129
|
+
if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet 2>/dev/null; then
|
130
|
+
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet -D master >/dev/null 2>&1
|
131
|
+
else
|
132
|
+
echo >&2 "Your version of git is out of date. Please update it!"
|
133
|
+
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1
|
134
|
+
fi
|
135
|
+
fi
|
136
|
+
|
137
|
+
echo "=> Compressing and cleaning up git repository"
|
138
|
+
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" reflog expire --expire=now --all; then
|
139
|
+
echo >&2 "Your version of git is out of date. Please update it!"
|
140
|
+
fi
|
141
|
+
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then
|
142
|
+
echo >&2 "Your version of git is out of date. Please update it!"
|
143
|
+
fi
|
144
|
+
return
|
145
|
+
}
|
146
|
+
|
147
|
+
#
|
148
|
+
# Automatically install Node.js
|
149
|
+
#
|
150
|
+
nvm_install_node() {
|
151
|
+
local NODE_VERSION_LOCAL
|
152
|
+
NODE_VERSION_LOCAL="$(nvm_node_version)"
|
153
|
+
|
154
|
+
if [ -z "$NODE_VERSION_LOCAL" ]; then
|
155
|
+
return 0
|
156
|
+
fi
|
157
|
+
|
158
|
+
echo "=> Installing Node.js version $NODE_VERSION_LOCAL"
|
159
|
+
nvm install "$NODE_VERSION_LOCAL"
|
160
|
+
local CURRENT_NVM_NODE
|
161
|
+
|
162
|
+
CURRENT_NVM_NODE="$(nvm_version current)"
|
163
|
+
if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then
|
164
|
+
echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"
|
165
|
+
else
|
166
|
+
echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"
|
167
|
+
fi
|
168
|
+
}
|
169
|
+
|
170
|
+
install_nvm_as_script() {
|
171
|
+
local INSTALL_DIR
|
172
|
+
INSTALL_DIR="$(nvm_install_dir)"
|
173
|
+
local NVM_SOURCE_LOCAL
|
174
|
+
NVM_SOURCE_LOCAL="$(nvm_source script)"
|
175
|
+
local NVM_EXEC_SOURCE
|
176
|
+
NVM_EXEC_SOURCE="$(nvm_source script-nvm-exec)"
|
177
|
+
local NVM_BASH_COMPLETION_SOURCE
|
178
|
+
NVM_BASH_COMPLETION_SOURCE="$(nvm_source script-nvm-bash-completion)"
|
179
|
+
|
180
|
+
# Downloading to $INSTALL_DIR
|
181
|
+
mkdir -p "$INSTALL_DIR"
|
182
|
+
if [ -f "$INSTALL_DIR/nvm.sh" ]; then
|
183
|
+
echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script"
|
184
|
+
else
|
185
|
+
echo "=> Downloading nvm as script to '$INSTALL_DIR'"
|
186
|
+
fi
|
187
|
+
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
|
188
|
+
echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
|
189
|
+
return 1
|
190
|
+
} &
|
191
|
+
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
|
192
|
+
echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
|
193
|
+
return 2
|
194
|
+
} &
|
195
|
+
nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || {
|
196
|
+
echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
|
197
|
+
return 2
|
198
|
+
} &
|
199
|
+
for job in $(jobs -p | command sort)
|
200
|
+
do
|
201
|
+
wait "$job" || return $?
|
202
|
+
done
|
203
|
+
chmod a+x "$INSTALL_DIR/nvm-exec" || {
|
204
|
+
echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
|
205
|
+
return 3
|
206
|
+
}
|
207
|
+
}
|
208
|
+
|
209
|
+
nvm_try_profile() {
|
210
|
+
if [ -z "${1-}" ] || [ ! -f "${1}" ]; then
|
211
|
+
return 1
|
212
|
+
fi
|
213
|
+
echo "${1}"
|
214
|
+
}
|
215
|
+
|
216
|
+
#
|
217
|
+
# Detect profile file if not specified as environment variable
|
218
|
+
# (eg: PROFILE=~/.myprofile)
|
219
|
+
# The echo'ed path is guaranteed to be an existing file
|
220
|
+
# Otherwise, an empty string is returned
|
221
|
+
#
|
222
|
+
nvm_detect_profile() {
|
223
|
+
if [ "${PROFILE-}" = '/dev/null' ]; then
|
224
|
+
# the user has specifically requested NOT to have nvm touch their profile
|
225
|
+
return
|
226
|
+
fi
|
227
|
+
|
228
|
+
if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then
|
229
|
+
echo "${PROFILE}"
|
230
|
+
return
|
231
|
+
fi
|
232
|
+
|
233
|
+
local DETECTED_PROFILE
|
234
|
+
DETECTED_PROFILE=''
|
235
|
+
|
236
|
+
if [ -n "${BASH_VERSION-}" ]; then
|
237
|
+
if [ -f "$HOME/.bashrc" ]; then
|
238
|
+
DETECTED_PROFILE="$HOME/.bashrc"
|
239
|
+
elif [ -f "$HOME/.bash_profile" ]; then
|
240
|
+
DETECTED_PROFILE="$HOME/.bash_profile"
|
241
|
+
fi
|
242
|
+
elif [ -n "${ZSH_VERSION-}" ]; then
|
243
|
+
DETECTED_PROFILE="$HOME/.zshrc"
|
244
|
+
fi
|
245
|
+
|
246
|
+
if [ -z "$DETECTED_PROFILE" ]; then
|
247
|
+
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zshrc"
|
248
|
+
do
|
249
|
+
if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then
|
250
|
+
break
|
251
|
+
fi
|
252
|
+
done
|
253
|
+
fi
|
254
|
+
|
255
|
+
if [ -n "$DETECTED_PROFILE" ]; then
|
256
|
+
echo "$DETECTED_PROFILE"
|
257
|
+
fi
|
258
|
+
}
|
259
|
+
|
260
|
+
#
|
261
|
+
# Check whether the user has any globally-installed npm modules in their system
|
262
|
+
# Node, and warn them if so.
|
263
|
+
#
|
264
|
+
nvm_check_global_modules() {
|
265
|
+
command -v npm >/dev/null 2>&1 || return 0
|
266
|
+
|
267
|
+
local NPM_VERSION
|
268
|
+
NPM_VERSION="$(npm --version)"
|
269
|
+
NPM_VERSION="${NPM_VERSION:--1}"
|
270
|
+
[ "${NPM_VERSION%%[!-0-9]*}" -gt 0 ] || return 0
|
271
|
+
|
272
|
+
local NPM_GLOBAL_MODULES
|
273
|
+
NPM_GLOBAL_MODULES="$(
|
274
|
+
npm list -g --depth=0 |
|
275
|
+
command sed -e '/ npm@/d' -e '/ (empty)$/d'
|
276
|
+
)"
|
277
|
+
|
278
|
+
local MODULE_COUNT
|
279
|
+
MODULE_COUNT="$(
|
280
|
+
command printf %s\\n "$NPM_GLOBAL_MODULES" |
|
281
|
+
command sed -ne '1!p' | # Remove the first line
|
282
|
+
wc -l | command tr -d ' ' # Count entries
|
283
|
+
)"
|
284
|
+
|
285
|
+
if [ "${MODULE_COUNT}" != '0' ]; then
|
286
|
+
# shellcheck disable=SC2016
|
287
|
+
echo '=> You currently have modules installed globally with `npm`. These will no'
|
288
|
+
# shellcheck disable=SC2016
|
289
|
+
echo '=> longer be linked to the active version of Node when you install a new node'
|
290
|
+
# shellcheck disable=SC2016
|
291
|
+
echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)'
|
292
|
+
# shellcheck disable=SC2016
|
293
|
+
echo '=> override the binaries of modules installed with `nvm`:'
|
294
|
+
echo
|
295
|
+
|
296
|
+
command printf %s\\n "$NPM_GLOBAL_MODULES"
|
297
|
+
echo '=> If you wish to uninstall them at a later point (or re-install them under your'
|
298
|
+
# shellcheck disable=SC2016
|
299
|
+
echo '=> `nvm` Nodes), you can remove them from the system Node as follows:'
|
300
|
+
echo
|
301
|
+
echo ' $ nvm use system'
|
302
|
+
echo ' $ npm uninstall -g a_module'
|
303
|
+
echo
|
304
|
+
fi
|
305
|
+
}
|
306
|
+
|
307
|
+
nvm_do_install() {
|
308
|
+
if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then
|
309
|
+
if [ -e "${NVM_DIR}" ]; then
|
310
|
+
echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory."
|
311
|
+
exit 1
|
312
|
+
fi
|
313
|
+
|
314
|
+
if [ "${NVM_DIR}" = "$(nvm_default_install_dir)" ]; then
|
315
|
+
mkdir "${NVM_DIR}"
|
316
|
+
else
|
317
|
+
echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment."
|
318
|
+
exit 1
|
319
|
+
fi
|
320
|
+
fi
|
321
|
+
if [ -z "${METHOD}" ]; then
|
322
|
+
# Autodetect install method
|
323
|
+
if nvm_has git; then
|
324
|
+
install_nvm_from_git
|
325
|
+
elif nvm_has nvm_download; then
|
326
|
+
install_nvm_as_script
|
327
|
+
else
|
328
|
+
echo >&2 'You need git, curl, or wget to install nvm'
|
329
|
+
exit 1
|
330
|
+
fi
|
331
|
+
elif [ "${METHOD}" = 'git' ]; then
|
332
|
+
if ! nvm_has git; then
|
333
|
+
echo >&2 "You need git to install nvm"
|
334
|
+
exit 1
|
335
|
+
fi
|
336
|
+
install_nvm_from_git
|
337
|
+
elif [ "${METHOD}" = 'script' ]; then
|
338
|
+
if ! nvm_has nvm_download; then
|
339
|
+
echo >&2 "You need curl or wget to install nvm"
|
340
|
+
exit 1
|
341
|
+
fi
|
342
|
+
install_nvm_as_script
|
343
|
+
else
|
344
|
+
echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method."
|
345
|
+
exit 1
|
346
|
+
fi
|
347
|
+
|
348
|
+
echo
|
349
|
+
|
350
|
+
local NVM_PROFILE
|
351
|
+
NVM_PROFILE="$(nvm_detect_profile)"
|
352
|
+
local PROFILE_INSTALL_DIR
|
353
|
+
PROFILE_INSTALL_DIR="$(nvm_install_dir | command sed "s:^$HOME:\$HOME:")"
|
354
|
+
|
355
|
+
SOURCE_STR="\\nexport NVM_DIR=\"${PROFILE_INSTALL_DIR}\"\\n[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm\\n"
|
356
|
+
|
357
|
+
# shellcheck disable=SC2016
|
358
|
+
COMPLETION_STR='[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion\n'
|
359
|
+
BASH_OR_ZSH=false
|
360
|
+
|
361
|
+
if [ -z "${NVM_PROFILE-}" ] ; then
|
362
|
+
local TRIED_PROFILE
|
363
|
+
if [ -n "${PROFILE}" ]; then
|
364
|
+
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
|
365
|
+
fi
|
366
|
+
echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
|
367
|
+
echo "=> Create one of them and run this script again"
|
368
|
+
echo " OR"
|
369
|
+
echo "=> Append the following lines to the correct file yourself:"
|
370
|
+
command printf "${SOURCE_STR}"
|
371
|
+
echo
|
372
|
+
else
|
373
|
+
if nvm_profile_is_bash_or_zsh "${NVM_PROFILE-}"; then
|
374
|
+
BASH_OR_ZSH=true
|
375
|
+
fi
|
376
|
+
if ! command grep -qc '/nvm.sh' "$NVM_PROFILE"; then
|
377
|
+
echo "=> Appending nvm source string to $NVM_PROFILE"
|
378
|
+
command printf "${SOURCE_STR}" >> "$NVM_PROFILE"
|
379
|
+
else
|
380
|
+
echo "=> nvm source string already in ${NVM_PROFILE}"
|
381
|
+
fi
|
382
|
+
# shellcheck disable=SC2016
|
383
|
+
if ${BASH_OR_ZSH} && ! command grep -qc '$NVM_DIR/bash_completion' "$NVM_PROFILE"; then
|
384
|
+
echo "=> Appending bash_completion source string to $NVM_PROFILE"
|
385
|
+
command printf "$COMPLETION_STR" >> "$NVM_PROFILE"
|
386
|
+
else
|
387
|
+
echo "=> bash_completion source string already in ${NVM_PROFILE}"
|
388
|
+
fi
|
389
|
+
fi
|
390
|
+
if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then
|
391
|
+
echo "=> Please also append the following lines to the if you are using bash/zsh shell:"
|
392
|
+
command printf "${COMPLETION_STR}"
|
393
|
+
fi
|
394
|
+
|
395
|
+
# Source nvm
|
396
|
+
# shellcheck source=/dev/null
|
397
|
+
\. "$(nvm_install_dir)/nvm.sh"
|
398
|
+
|
399
|
+
nvm_check_global_modules
|
400
|
+
|
401
|
+
nvm_install_node
|
402
|
+
|
403
|
+
nvm_reset
|
404
|
+
|
405
|
+
echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:"
|
406
|
+
command printf "${SOURCE_STR}"
|
407
|
+
if ${BASH_OR_ZSH} ; then
|
408
|
+
command printf "${COMPLETION_STR}"
|
409
|
+
fi
|
410
|
+
}
|
411
|
+
|
412
|
+
#
|
413
|
+
# Unsets the various functions defined
|
414
|
+
# during the execution of the install script
|
415
|
+
#
|
416
|
+
nvm_reset() {
|
417
|
+
unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \
|
418
|
+
nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \
|
419
|
+
install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \
|
420
|
+
nvm_do_install nvm_reset nvm_default_install_dir
|
421
|
+
}
|
422
|
+
|
423
|
+
[ "_$NVM_ENV" = "_testing" ] || nvm_do_install
|
424
|
+
|
425
|
+
} # this ensures the entire script is downloaded #
|
data/lib/vitat/css/version.rb
CHANGED