Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bash Headstart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cybersecurity
Bash Headstart
Commits
a37fa305
Commit
a37fa305
authored
4 years ago
by
Nikolaos Kakouros
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
f8c79667
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
headstart-core.bash
+10
-9
10 additions, 9 deletions
headstart-core.bash
lib/io
+4
-2
4 additions, 2 deletions
lib/io
with
14 additions
and
11 deletions
headstart-core.bash
+
10
−
9
View file @
a37fa305
...
...
@@ -50,12 +50,6 @@ cd "$PROJECT_DIR"
.
"
$_HEADSTART_CORE_DIR
/headstart-load-libs.bash"
"
$@
"
\
"
${
_HEADSTART_CORE_DIR
#
$PROJECT_DIR
/
}
/"
{
commands,
}
tmp_dir
=
"
${
_HEADSTART_SCRIPT_NAME
~~
}
_TMP_DIR"
declare
-gx
_HEADSTART_TMP_DIR
=
"
${
!tmp_dir
}
"
declare
-gx
_HEADSTART_VENDOR_DIR
=
"
${
_HEADSTART_CORE_DIR
}
/vendor"
declare
-gx
HEADSTART_RESOURCES_DIR
=
"
${
HEADSTART_RESOURCES_DIR
-resources
}
"
declare
-gx
_HEADSTART_CMD
=
"
${
_GO_CMD
##*/
}
"
declare
-gx
_HEADSTART_PROJECT_CONFIG
=
"
${
HEADSTART_PROJECT_CONFIG
-data/config/project.conf
}
"
declare
-gx
_HEADSTART_CORE_LOCK
=
"
${
HEADSTART_CORE_LOCK
-data/config/.core.lock
}
"
...
...
@@ -64,9 +58,17 @@ declare -x _GO_HELP_HIJACK=true
declare
-x
GO_TAB_COMPLETIONS_PATTERN
=
''
.
"
$_GO_USE_MODULES
"
'core'
core_get_installed_version
core_parse_project_config
function
headstart_bootstrap
()
{
tmp_dir
=
"
${
_HEADSTART_SCRIPT_NAME
~~
}
_TMP_DIR"
declare
-gx
_HEADSTART_TMP_DIR
=
"
${
!tmp_dir
}
"
declare
-gx
_HEADSTART_VENDOR_DIR
=
"
${
_HEADSTART_CORE_DIR
}
/vendor"
declare
-gx
HEADSTART_RESOURCES_DIR
=
"
${
HEADSTART_RESOURCES_DIR
-resources
}
"
core_parse_project_config
}
function
headstart
()
{
local
trace
=
false
...
...
@@ -137,7 +139,6 @@ function headstart() {
.
"
$_GO_USE_MODULES
"
'system'
set_standard_outputs
set_trace
"
$debug
"
set_debug_levels
"
$verbosity
"
unset
verbosity
...
...
This diff is collapsed.
Click to expand it.
lib/io
+
4
−
2
View file @
a37fa305
...
...
@@ -127,7 +127,7 @@ function abort() {
function
warn
()
{
@required
[
string] message
COLUMNS
=
9
1 @go.printf
"
${
UI_Color_Magenta
}
Warning: %b%s
${
UI_Color_Default
}
\n
"
"
$message
"
>
&
"
${
STDERR
}
"
COLUMNS
=
1
00
@go.printf
"
${
UI_Color_Magenta
}
Warning: %b%s
${
UI_Color_Default
}
\n
"
"
$message
"
>
&
"
${
STDERR
}
"
}
function
set_standard_outputs
()
{
...
...
@@ -147,7 +147,7 @@ function set_standard_outputs() {
exec
9>&2
exec
1>&2
if
[
"
$debug
"
=
ffffalse
]
;
then
if
[
[
"
$
{
debug
-false
}
"
=
=
ffffalse
]
]
;
then
# We do not want to output every command run in the scripts to the screen.
# We only want to do that if the user requested it for debugging purposes.
# Otherwise, we need to output only informational text with the `info`
...
...
@@ -168,3 +168,5 @@ function color_stderr() {
@required
[
string]
command
"
$@
"
2>
>(
while
read
line
;
do
echo
-e
"
\e
[01;31merror:
$line
\e
[0m"
>
&2
;
done
)
}
set_standard_outputs
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment