2024-09-30
This commit is contained in:
parent
15d28a54dc
commit
4c0e47830c
3 changed files with 9 additions and 9 deletions
|
@ -47,14 +47,14 @@ function directory_tree {
|
||||||
if [ -d "$path" ]; then
|
if [ -d "$path" ]; then
|
||||||
local list # array of files and directories
|
local list # array of files and directories
|
||||||
readarray -t list <<<"$(list_directory_contents "$path")"
|
readarray -t list <<<"$(list_directory_contents "$path")"
|
||||||
local len=${#list[@]} # size of array
|
local size=${#list[@]} # length of array
|
||||||
local i # counter
|
local i # counter
|
||||||
for ((i = 0; i < len; i++)); do
|
for ((i = 0; i < size; i++)); do
|
||||||
if [ -z "${list[$i]}" ]; then
|
if [ -z "${list[$i]}" ]; then
|
||||||
continue # skip empty directory
|
continue # skip empty directory
|
||||||
elif ((len == 1)); then
|
elif ((size == 1)); then
|
||||||
directory_tree "$path/${list[$i]}" "$tail" "$tail" "one"
|
directory_tree "$path/${list[$i]}" "$tail" "$tail" "one"
|
||||||
elif ((i < len - 1)); then
|
elif ((i < size - 1)); then
|
||||||
directory_tree "$path/${list[$i]}" "$tail├─ " "$tail│ "
|
directory_tree "$path/${list[$i]}" "$tail├─ " "$tail│ "
|
||||||
else
|
else
|
||||||
directory_tree "$path/${list[$i]}" "$tail└─ " "$tail "
|
directory_tree "$path/${list[$i]}" "$tail└─ " "$tail "
|
||||||
|
|
|
@ -46,14 +46,14 @@ function directory_tree {
|
||||||
if [ -d "$path" ]; then
|
if [ -d "$path" ]; then
|
||||||
local list # массив файлов и каталогов
|
local list # массив файлов и каталогов
|
||||||
readarray -t list <<<"$(list_directory_contents "$path")"
|
readarray -t list <<<"$(list_directory_contents "$path")"
|
||||||
local len=${#list[@]} # размер массива
|
local size=${#list[@]} # длина массива
|
||||||
local i # счётчик
|
local i # счётчик
|
||||||
for ((i = 0; i < len; i++)); do
|
for ((i = 0; i < size; i++)); do
|
||||||
if [ -z "${list[$i]}" ]; then
|
if [ -z "${list[$i]}" ]; then
|
||||||
continue # пропустить пустой каталог
|
continue # пропустить пустой каталог
|
||||||
elif ((len == 1)); then
|
elif ((size == 1)); then
|
||||||
directory_tree "$path/${list[$i]}" "$tail" "$tail" "one"
|
directory_tree "$path/${list[$i]}" "$tail" "$tail" "one"
|
||||||
elif ((i < len - 1)); then
|
elif ((i < size - 1)); then
|
||||||
directory_tree "$path/${list[$i]}" "$tail├─ " "$tail│ "
|
directory_tree "$path/${list[$i]}" "$tail├─ " "$tail│ "
|
||||||
else
|
else
|
||||||
directory_tree "$path/${list[$i]}" "$tail└─ " "$tail "
|
directory_tree "$path/${list[$i]}" "$tail└─ " "$tail "
|
||||||
|
|
2
serve.sh
2
serve.sh
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "Локальное развёртывание для проверки корректности сборки."
|
echo "Локальное развёртывание для проверки корректности сборки."
|
||||||
jekyll serve --skip-initial-build --disable-disk-cache --host localhost
|
jekyll serve --skip-initial-build --no-watch --disable-disk-cache --host localhost
|
||||||
echo "Адрес сервера: http://localhost:4000"
|
echo "Адрес сервера: http://localhost:4000"
|
||||||
|
|
Loading…
Add table
Reference in a new issue