First Commit
This commit is contained in:
12
deps/acore/bash-lib/.gitrepo
vendored
Normal file
12
deps/acore/bash-lib/.gitrepo
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
; DO NOT EDIT (unless you know what you are doing)
|
||||
;
|
||||
; This subdirectory is a git "subrepo", and this file is maintained by the
|
||||
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
||||
;
|
||||
[subrepo]
|
||||
remote = https://github.com/azerothcore/bash-lib
|
||||
branch = master
|
||||
commit = 86fcff1dd6167078f863d45b3cd233e802bebe89
|
||||
parent = 0ebf9eb7365e4c73f423e2acd9fb1f21b84c6ef6
|
||||
method = merge
|
||||
cmdver = 0.4.3
|
||||
7
deps/acore/bash-lib/bin/git-subtree-list
vendored
Normal file
7
deps/acore/bash-lib/bin/git-subtree-list
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source $CUR_DIR"/../src/subtree.sh"
|
||||
|
||||
subtreeFlow
|
||||
23
deps/acore/bash-lib/docs/README.md
vendored
Normal file
23
deps/acore/bash-lib/docs/README.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# BASH-LIB
|
||||
|
||||
## description
|
||||
|
||||
bash-lib is a collection of generic purpose functions and defines that can be used
|
||||
and shared by other bash scripts.
|
||||
|
||||
## Documentation
|
||||
|
||||
### src/event
|
||||
|
||||
Libraries for event-driven functions
|
||||
|
||||
#### hooks.sh
|
||||
|
||||
Library that implements a simple Observer Pattern
|
||||
|
||||
### src/git-utils
|
||||
|
||||
#### subrepo.sh
|
||||
|
||||
|
||||
#### subtree.sh
|
||||
152
deps/acore/bash-lib/docs/_config.yml
vendored
Normal file
152
deps/acore/bash-lib/docs/_config.yml
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
# based on git-wiki-theme 2.6.1
|
||||
remote_theme: Drassil/git-wiki-theme@master
|
||||
# (string) Title of your wiki
|
||||
title: "bash-lib"
|
||||
baseurl: /bash-lib/
|
||||
# (string) if you've installed your wiki in subfolder, you must change this configuration
|
||||
# with your folder name, otherwise leave it empty
|
||||
# baseurl: "/git-wiki-skeleton"
|
||||
# (string) Description of your wiki
|
||||
description:
|
||||
# (boolean) Enable/disable wiki page list in sidebar
|
||||
show_wiki_pages: true
|
||||
# (integer) Maximum number of wiki page to shown in sidebar
|
||||
show_wiki_pages_limit: 10
|
||||
# (boolean) Enable/disable blog feature
|
||||
blog_feature: true
|
||||
# (boolean) Enable/disable wiki posts list in sidebar (needs blog_feature enabled)
|
||||
show_wiki_posts: true
|
||||
# (integer) Maximum number of wiki posts to shown in sidebar
|
||||
show_wiki_posts_limit: 10
|
||||
# from jekyll (read jekyll doc)
|
||||
paginate: 5
|
||||
paginate_path: "/blog/page:num"
|
||||
permalink: /blog/posts/:year/:month/:day/:title:output_ext
|
||||
# (boolean) Enable/disable download buttons in sidebar
|
||||
show_downloads: true
|
||||
# (string) Specify branch rendered by gitpages allowing wiki tool buttons to work
|
||||
git_branch: "master"
|
||||
# (string) Url of logo image, it can be full, absolute or relative.
|
||||
logo_url: https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Gnu-bash-logo.svg/1200px-Gnu-bash-logo.svg.png
|
||||
# (string) The UA-XXXXX-Y code from google analytic to enable GA on your wiki
|
||||
google_analytics:
|
||||
# (string) folder where wiki pages are stored, it's needed for tool buttons
|
||||
wiki_folder:
|
||||
# (boolean) if you're using github wiki as submodule then this config
|
||||
# must be enabled to allow tool buttons to work properly
|
||||
use_github_wiki: false
|
||||
# (boolean) Enable "Edit with Prose.io" button in tools, it's a 3rd party
|
||||
# service to edit github markdown pages easily
|
||||
use_prose_io: true
|
||||
# Select search_engine component from:
|
||||
# - js: it uses a built in javascript component that uses generated js object
|
||||
# - js_rss: it uses a built in javascript component that uses generated sitemap_full.xml to search inside your wiki with lunr library (slow and experimental)
|
||||
# - github : it uses internal github repository search
|
||||
# - google : it uses cse search bar, you need to configure google_cse_token
|
||||
#
|
||||
search_engine : "js"
|
||||
# Setting google custom search engine for google. Default: empty
|
||||
# cse search bar (https://cse.google.it/cse/)
|
||||
google_cse_token:
|
||||
|
||||
|
||||
# (string) path of site root. Normally it's must be empty because _config.yml resides in the root of your repository.
|
||||
# If you have _config.yml and your site in a subfolder, then change this config accordly
|
||||
site_root: docs/
|
||||
|
||||
#
|
||||
# Jekyll configurations
|
||||
#
|
||||
|
||||
# You can customize it changing default layout for all pages
|
||||
# More info: https://jekyllrb.com/docs/configuration/
|
||||
#
|
||||
# git-wiki includes some internal themes that you can choose
|
||||
# check _layouts folder
|
||||
#
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
kramdown:
|
||||
input: GFM
|
||||
syntax_highlighter: rouge
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "wiki"
|
||||
values:
|
||||
permalink: /:basename
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
layout: "git-wiki-default"
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "pages"
|
||||
values:
|
||||
layout: "git-wiki-default"
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "posts"
|
||||
values:
|
||||
layout: "git-wiki-post"
|
||||
-
|
||||
scope:
|
||||
path: blog
|
||||
values:
|
||||
layout: "git-wiki-blog"
|
||||
sass:
|
||||
style: compressed
|
||||
plugins:
|
||||
- jekyll-avatar
|
||||
- jekyll-coffeescript
|
||||
- jekyll-default-layout
|
||||
- jekyll-feed
|
||||
- jekyll-gist
|
||||
- jekyll-paginate
|
||||
- jekyll-mentions
|
||||
- jekyll-optional-front-matter
|
||||
- jekyll-readme-index
|
||||
- jekyll-redirect-from
|
||||
- jekyll-remote-theme
|
||||
- jekyll-relative-links
|
||||
- jekyll-seo-tag
|
||||
- jekyll-sitemap
|
||||
- jekyll-titles-from-headings
|
||||
- jemoji
|
||||
- jekyll-gitlab-metadata
|
||||
|
||||
#
|
||||
# INCLUDING HOOKS
|
||||
# They are optional, change them only if you need
|
||||
# Check wiki documentation to learn how they work
|
||||
#
|
||||
|
||||
inc_before_toc :
|
||||
inc_after_toc :
|
||||
inc_before_content :
|
||||
inc_after_content :
|
||||
inc_before_footer :
|
||||
inc_after_footer :
|
||||
inc_before_head :
|
||||
inc_after_head :
|
||||
inc_before_meta :
|
||||
inc_after_meta :
|
||||
inc_before_scripts :
|
||||
inc_after_scripts :
|
||||
inc_before_styles :
|
||||
inc_after_styles :
|
||||
inc_before_header :
|
||||
inc_after_header :
|
||||
inc_before_tail :
|
||||
inc_after_tail :
|
||||
inc_before_tools :
|
||||
inc_after_tools :
|
||||
|
||||
inc_before_page_list :
|
||||
inc_after_page_list :
|
||||
inc_before_post_list :
|
||||
inc_after_post_list :
|
||||
16
deps/acore/bash-lib/src/event/hooks.sh
vendored
Normal file
16
deps/acore/bash-lib/src/event/hooks.sh
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# par 1: hook_name
|
||||
function acore_event_runHooks() {
|
||||
hook_name="HOOKS_MAP_$1"
|
||||
read -r -a SRCS <<< ${!hook_name}
|
||||
echo "Running hooks: $hook_name"
|
||||
for i in "${SRCS[@]}"
|
||||
do
|
||||
$i # run registered hook
|
||||
done
|
||||
}
|
||||
|
||||
function acore_event_registerHooks() {
|
||||
hook_name="HOOKS_MAP_$1"
|
||||
hooks=${@:2}
|
||||
declare -g "$hook_name+=$hooks "
|
||||
}
|
||||
36
deps/acore/bash-lib/src/git-utils/subrepo.sh
vendored
Normal file
36
deps/acore/bash-lib/src/git-utils/subrepo.sh
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
|
||||
|
||||
echo "> Init and updating submodules..."
|
||||
|
||||
function subrepoUpdate() {
|
||||
repo=$1
|
||||
branch=$2
|
||||
folder=$3
|
||||
|
||||
toClone=$(git ls-remote --heads "$repo" "$branch" | wc -l)
|
||||
|
||||
if [[ -d "$folder" ]]; then
|
||||
if [[ ! -f "$folder/.gitrepo" ]]; then
|
||||
git subrepo init "$folder" -r "$repo" -b "$branch"
|
||||
fi
|
||||
|
||||
if [[ $toClone -eq 0 ]]; then
|
||||
git subrepo push "$folder"
|
||||
fi
|
||||
else
|
||||
# try-catch
|
||||
set +e
|
||||
git subrepo clone "$repo" "$folder" -b "$branch"
|
||||
set -e
|
||||
fi
|
||||
|
||||
git subrepo clean "$folder"
|
||||
git subrepo pull "$folder"
|
||||
git subrepo push "$folder" -s
|
||||
git subrepo clean "$folder"
|
||||
}
|
||||
12
deps/acore/bash-lib/src/git-utils/subtree.sh
vendored
Normal file
12
deps/acore/bash-lib/src/git-utils/subtree.sh
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
function subtreeFlow {
|
||||
local name=$1
|
||||
local path=$2
|
||||
local repo=$3
|
||||
local branch=$4
|
||||
local prefix="$path/$name"
|
||||
|
||||
echo "> Adding subtree if not exists"
|
||||
git subtree add --prefix "$prefix" "$repo" "$branch"
|
||||
echo "> Pulling latest changes from remote subtree"
|
||||
git subtree pull --prefix "$prefix" "$repo" "$branch"
|
||||
}
|
||||
Reference in New Issue
Block a user