Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
15f342bf
Commit
15f342bf
authored
1 year ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
Now sbs configuration automatically registers the autocompletion scripts
parent
0db27400
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/sbs_autocomplete
+25
-17
25 additions, 17 deletions
scripts/sbs_autocomplete
scripts/sbs_implementation
+33
-0
33 additions, 0 deletions
scripts/sbs_implementation
with
58 additions
and
17 deletions
scripts/sbs_autocomplete
+
25
−
17
View file @
15f342bf
...
@@ -20,17 +20,25 @@
...
@@ -20,17 +20,25 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# THE SOFTWARE.
source
"
$(
cd
--
"
$(
dirname
"
$0
"
)
"
>
/dev/null 2>&1
&&
pwd
-P
)
/sbs_implementation"
current_path
=
"
$(
cd
--
"
$(
dirname
"
$0
"
)
"
>
/dev/null 2>&1
&&
pwd
-P
)
"
# Target directory name
target_dir
=
"skyward-boardcore"
# Cut the path to the target directory
while
[[
"
$current_path
"
!=
"/"
&&
"
$(
basename
"
$current_path
"
)
"
!=
"
$target_dir
"
]]
;
do
current_path
=
"
$(
dirname
"
$current_path
"
)
"
done
source
"
$current_path
/scripts/sbs_implementation"
function
_sbs_autocomplete
()
{
function
_sbs_autocomplete
()
{
local
curr_arg
=
"
${
COMP_WORDS
[COMP_CWORD]
}
"
declare
curr_arg
=
"
${
COMP_WORDS
[COMP_CWORD]
}
"
local
prev_arg
=
"
${
COMP_WORDS
[COMP_CWORD
-
1]
}
"
declare
prev_arg
=
"
${
COMP_WORDS
[COMP_CWORD
-
1]
}
"
case
"
$prev_arg
"
in
case
"
$prev_arg
"
in
"-b"
|
"--build"
)
"-b"
|
"--build"
)
;
&
;
&
"-f"
|
"--flash"
)
;
&
"-f"
|
"--flash"
)
;
&
"-t"
|
"--test"
)
"-t"
|
"--test"
)
# Autocomplete options for build, flash and test
# Autocomplete options for build, flash and test
init_dirs
init_dirs
...
...
This diff is collapsed.
Click to expand it.
scripts/sbs_implementation
+
33
−
0
View file @
15f342bf
...
@@ -126,6 +126,39 @@ configure() {
...
@@ -126,6 +126,39 @@ configure() {
{
[
"
$config_debug
"
=
true
]
&&
touch
"
$build_dir
/
$DEBUG_FILENAME
"
;
}
||
rm
-f
"
$build_dir
/
$DEBUG_FILENAME
"
{
[
"
$config_debug
"
=
true
]
&&
touch
"
$build_dir
/
$DEBUG_FILENAME
"
;
}
||
rm
-f
"
$build_dir
/
$DEBUG_FILENAME
"
{
[
"
$config_verbose
"
=
true
]
&&
touch
"
$build_dir
/
$VERBOSE_FILENAME
"
;
}
||
rm
-f
"
$build_dir
/
$VERBOSE_FILENAME
"
{
[
"
$config_verbose
"
=
true
]
&&
touch
"
$build_dir
/
$VERBOSE_FILENAME
"
;
}
||
rm
-f
"
$build_dir
/
$VERBOSE_FILENAME
"
install_autocompletion
}
install_autocompletion
()
{
declare
autocomplete_script
=
"
$sbs_base
/scripts/sbs_autocomplete"
declare
-A
shell_files
=(
[
"bash"
]=
"
$HOME
/.bashrc"
[
"zsh"
]=
"
$HOME
/.zshrc"
[
"fish"
]=
"
$HOME
/.config/fish/config.fish"
)
declare
-a
installed_shells
for
shell
in
"
${
!shell_files[@]
}
"
;
do
local
shell_file
=
"
${
shell_files
[
$shell
]
}
"
if
[[
-f
"
$shell_file
"
]]
;
then
if
!
grep
-q
"source
$autocomplete_script
"
"
$shell_file
"
;
then
echo
"source
$autocomplete_script
"
>>
"
$shell_file
"
fi
installed_shells+
=(
"
$shell
"
)
fi
done
if
[[
${#
installed_shells
[@]
}
-gt
0
]]
;
then
echo
"Autocomplete script has been added for the following shells:"
for
shell
in
"
${
installed_shells
[@]
}
"
;
do
echo
"-
$shell
"
done
else
echo
"No supported shells found. Please add the following line to your shell's initialization file manually: 'source
$autocomplete_script
'"
fi
}
}
check_configured
()
{
check_configured
()
{
...
...
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