Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp_create_scripts
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
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
ricardo.dossanto1
tp_create_scripts
Compare revisions
2b1fa2f296c999b0330ef1330483732431a6afbf to 1f6bb0a67c30cdd8e01f39cc8989c3aaae4acc5f
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ricardo.dossanto1/tp_create_scripts
Select target project
No results found
1f6bb0a67c30cdd8e01f39cc8989c3aaae4acc5f
Select Git revision
Branches
master
1 result
Swap
Target
ricardo.dossanto1/tp_create_scripts
Select target project
ricardo.dossanto1/tp_create_scripts
1 result
2b1fa2f296c999b0330ef1330483732431a6afbf
Select Git revision
Branches
master
1 result
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Auto commit generation via script
· 3199ee9d
ricardo.dossanto1
authored
2 years ago
3199ee9d
added a prototype of exam creating script
· 1f6bb0a6
ricardo.dossanto1
authored
2 years ago
1f6bb0a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure_tp_script.sh
+0
-0
0 additions, 0 deletions
configure_tp_script.sh
exam_create.sh
+80
-0
80 additions, 0 deletions
exam_create.sh
test.sh
+9
-0
9 additions, 0 deletions
test.sh
tp_create.sh
+4
-2
4 additions, 2 deletions
tp_create.sh
with
93 additions
and
2 deletions
configure.sh
→
configure
_tp_script
.sh
View file @
1f6bb0a6
File moved
This diff is collapsed.
Click to expand it.
exam_create.sh
0 → 100755
View file @
1f6bb0a6
#!/bin/bash
shopt
-s
-o
nounset
declare
EXAM_NAME
declare
DIRECTORY
=
""
declare
NBR_EXO
=
1
declare
LOOP_START
=
1
if
test
$#
-lt
2
;
then
echo
"Usage:
$0
EXAM_NAME nbrExercices"
exit
-1
fi
EXAM_NAME
=
$1
if
!
[[
"
$2
"
=
~ ^[0-9]+
$
]]
then
echo
"
$2
is not a number (integer)"
exit
-5
fi
NBR_EXO
=
$2
cd
$(
pwd
)
if
[[
"
$EXAM_NAME
"
=
~
(
|
\'
)
]]
;
then
echo
"EXAM_NAME should not contain spaces"
exit
-2
fi
if
test
-d
"
$EXAM_NAME
"
;
then
echo
"DIRECTORY already exists, please choose another name"
exit
-4
fi
mkdir
$EXAM_NAME
if
test
!
-d
"
$EXAM_NAME
"
;
then
echo
"mkdir creation failed, aborting..."
exit
-3
fi
cd
$EXAM_NAME
# git init
touch
".gitignore"
echo
-e
"### C ###
\n
*.o
\n
*.exe
\n
*.out
\n
*.app"
>
.gitignore
for
((
k
=
$LOOP_START
;
k<
=
$NBR_EXO
;
k++
))
do
if
test
-d
"exo
${
k
}
"
;
then
echo
"One of the exo directory already exists, aborting"
exit
-4
fi
mkdir
"exo
${
k
}
"
cd
"exo
${
k
}
"
touch
"Makefile"
echo
-e
"#the compiler
\n
CC:=gcc
\n
CFLAGS:=-g -Wall -Wextra -fsanitize=address -fsanitize=leak -std=gnu11
\n
#linker flags
\n
LDFLAGS:=-lm -lSDL2 -fsanitize=address
\n\n
FNAME:=exo
${
k
}
\n\n
exo
${
k
}
: exo
${
k
}
.o
\n\t\$
(CC) -o
\$
@
\$
^
\$
(LDFLAGS)
\n\t
./exo
${
k
}
\n
clean:
\n\t
@rm -f *.o exo
${
k
}
"
>
Makefile
# exit 0
touch
"exo
${
k
}
.c"
echo
-e
"int main(void){
\n
}"
>
"exo
${
k
}
.c"
cd
..
done
echo
$(
git remote add origin ssh://git@ssh.hesge.ch:10572/ricardo.dossanto1/
${
EXAM_NAME
}
)
declare
BRANCH_NAME
=
$(
git config init.defaultBranch
)
echo
$BRANCH_NAME
echo
$(
git add .
)
echo
$(
git commit
-m
"Auto commit generation via script"
)
echo
$(
git push
-u
origin
${
BRANCH_NAME
}
)
exit
0
This diff is collapsed.
Click to expand it.
test.sh
0 → 100755
View file @
1f6bb0a6
#!/bin/bash
shopt
-s
-o
nounset
declare
start
=
0
declare
end
=
5
for
((
k
=
$start
;
k<
=
$end
;
k++
))
do
echo
$k
done
This diff is collapsed.
Click to expand it.
tp_create.sh
View file @
1f6bb0a6
...
...
@@ -3,7 +3,7 @@
shopt
-s
-o
nounset
declare
TP_NAME
declare
DIRECTORY
=
""
declare
DIRECTORY
=
"
/home/rickyy/Desktop
"
if
test
$#
-lt
1
;
then
echo
"Usage:
$0
TP_NAME"
...
...
@@ -49,9 +49,11 @@ echo -e "#ifndef _${TP_NAME^^}_H_\n#define _${TP_NAME^^}_H_\n#include <stdio.h>\
pwd
echo
$(
git remote add origin ssh://git@ssh.hesge.ch:10572/ricardo.dossanto1/
${
TP_NAME
}
)
declare
BRANCH_NAME
=
$(
git config init.defaultBranch
)
echo
$BRANCH_NAME
echo
$(
git add .
)
echo
$(
git commit
-m
"Auto commit generation via script"
)
echo
$(
git push
-u
origin
master
)
echo
$(
git push
-u
origin
${
BRANCH_NAME
}
)
#cd "/home/ricky/Desktop/"
#rm -r $TP_NAME
...
...
This diff is collapsed.
Click to expand it.