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
9dffae71
Commit
9dffae71
authored
3 months ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
[skip ci] add exclude mark in license script
parent
b57642a8
No related branches found
No related tags found
1 merge request
!448
Draft: Resolve "Implementation of new nodes creation"
Pipeline
#20645
skipped
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/license_manager.sh
+13
-7
13 additions, 7 deletions
scripts/license_manager.sh
with
13 additions
and
7 deletions
scripts/license_manager.sh
+
13
−
7
View file @
9dffae71
...
...
@@ -120,10 +120,12 @@ fi
# DETECT FIRST AND LAST LICENSE LINES
sed
-i
-e
'/./,$!d'
-e
:a
-e
'/^\n*$/{$d;N;ba'
-e
'}'
$license
#remove empty lines at the beginning and at the end
line_start_mark
=
$(
head
-n
1
$license
)
#"//--------LICENSE_START--------"
line_end_mark
=
$(
tail
-n
1
$license
)
#"//--------LICENSE_END--------"
line_start_mark
=
$(
head
-n
1
$license
)
line_end_mark
=
$(
tail
-n
1
$license
)
exclude_mark
=
"// This is not part of WOLF"
echo
"line_start:
$line_start_mark
"
echo
"line_end:
$line_end_mark
"
echo
"excluding files starting with:
$exlude_mark
"
# PATH (AND tmp FOLDER)
folder
=
$path
...
...
@@ -169,12 +171,16 @@ if [ "$mode" == "add" ]; then
echo
"Recursively adding license header to all files (.c, .cpp, .h, .hpp):"
for
i
in
$file_list
do
if
grep
-m1
-Fxq
"
${
line_start
_mark
}
"
$i
;
then
:
if
grep
-m1
-Fxq
"
${
exlude
_mark
}
"
$i
;
then
echo
"excluding
${
i
}
since it contains exclude mark"
else
echo
" -
${
i
}
"
(
cat
${
license
}
;
cat
$i
)
>
temp_file
mv
temp_file
$i
if
grep
-m1
-Fxq
"
${
line_start_mark
}
"
$i
;
then
:
else
echo
" -
${
i
}
"
(
cat
${
license
}
;
cat
$i
)
>
temp_file
mv
temp_file
$i
fi
fi
done
fi
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