Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
57071fa0
Commit
57071fa0
authored
6 years ago
by
Joaquim Casals Buñuel
Browse files
Options
Downloads
Patches
Plain Diff
Added create_plugin script
parent
54e9107c
No related branches found
No related tags found
1 merge request
!260
WIP: params autoconf
Pipeline
#2597
passed
6 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wolf_scripts/create_plugin.sh
+75
-0
75 additions, 0 deletions
wolf_scripts/create_plugin.sh
with
75 additions
and
0 deletions
wolf_scripts/create_plugin.sh
0 → 100755
+
75
−
0
View file @
57071fa0
#!/bin/bash
# $1 path to the root of the plugin
# $2 name of the plugin
# $3 files to be moved
# Create the target directory
# if [ -d $1 ];
# then
# rm -rf $1
# fi
#Generate the necessary dirs
if
[
!
-d
$1
/include/
$2
]
;
then
mkdir
$1
/include/
$2
fi
for
folder
in
capture constraint feature landmark processor sensor
;
do
if
[
!
-d
$1
/include/
$2
/
$folder
]
;
then
mkdir
$1
/include/
$2
/
$folder
fi
if
[
!
-d
$1
/src/
$folder
]
;
then
mkdir
$1
/src/
$folder
fi
done
for
file
in
$(
cat
$3
)
;
do
head
=
$(
echo
$file
|
cut
-d
'/'
-f
1
)
if
[
"
$head
"
=
"include"
]
;
then
folder
=
$(
echo
$file
|
cut
-d
'/'
-f
3
)
suffix
=
$(
echo
$file
|
cut
-d
'/'
-f
4-
)
line
=
$(
ag
"HDRS_"
${
folder
^^
}
$1
/CMakeLists.txt |
cut
-d
':'
-f
1 |
head
-1
)
line
=
$((
$line
+
1
))
echo
$line
" && "
$file
" && "
$folder
" && "
$suffix
sed
-i
""
$line
"i
$head
/
$2
/
$folder
/
$suffix
"
$1
/CMakeLists.txt
cp
$file
$1
/
$head
/
$2
/
$folder
/
$suffix
else
folder
=
$(
echo
$file
|
cut
-d
'/'
-f
2
)
suffix
=
$(
echo
$file
|
cut
-d
'/'
-f
3-
)
ag
"SRCS_"
$folder
$1
/CMakeLists.txt
line
=
$(
ag
"SRCS_"
${
folder
^^
}
$1
/CMakeLists.txt |
cut
-d
':'
-f
1 |
head
-1
)
line
=
$((
$line
+
1
))
echo
$line
" && "
$file
" && "
$folder
" && "
$suffix
sed
-i
""
$line
"i
$file
"
$1
/CMakeLists.txt
cp
$file
$1
/
$head
/
$folder
/
$suffix
fi
done
for
f
in
$(
cat
$3
)
;
do
hhead
=
$(
echo
$f
|
cut
-d
'/'
-f
1
)
if
[
"
$hhead
"
=
"include"
]
;
then
ffolder
=
$(
echo
$f
|
cut
-d
'/'
-f
3
)
ssuffix
=
$(
echo
$f
|
cut
-d
'/'
-f
4-
)
inc
=
$ffolder
/
$ssuffix
else
continue
fi
for
ff
in
$(
cat
$3
)
;
do
head
=
$(
echo
$ff
|
cut
-d
'/'
-f
1
)
if
[
"
$head
"
=
"include"
]
;
then
folder
=
$(
echo
$ff
|
cut
-d
'/'
-f
3
)
suffix
=
$(
echo
$ff
|
cut
-d
'/'
-f
4-
)
new_path
=
$1
/
$head
/
$2
/
$folder
/
$suffix
# sed -n -E "s@(#include[[:space:]]+\")base(\/$inc\")@\1$2\2@pg" $new_path
sed
-i
-E
"s@(#include[[:space:]]+
\"
)base(
\/
$inc
\"
)@
\1
$2
\2
@g"
$new_path
else
folder
=
$(
echo
$ff
|
cut
-d
'/'
-f
2
)
suffix
=
$(
echo
$ff
|
cut
-d
'/'
-f
3-
)
new_path
=
$1
/
$head
/
$folder
/
$suffix
# sed -n -E "s@(#include[[:space:]]+\")base(\/$inc\")@\1$2\2@pg" $new_path
sed
-i
-E
"s@(#include[[:space:]]+
\"
)base(
\/
$inc
\"
)@
\1
$2
\2
@g"
$new_path
fi
done
done
\ No newline at end of file
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