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
Commits
2b1fa2f2
Commit
2b1fa2f2
authored
2 years ago
by
ricardo.dossanto1
Browse files
Options
Downloads
Patches
Plain Diff
ta soeur Antoine
parents
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
configure.sh
+18
-0
18 additions, 0 deletions
configure.sh
tp_create.sh
+58
-0
58 additions, 0 deletions
tp_create.sh
with
76 additions
and
0 deletions
configure.sh
0 → 100755
+
18
−
0
View file @
2b1fa2f2
#!/bin/bash
declare
USER_INPUT
=
"NULL"
PROMPT
=
">"
while
[
$USER_INPUT
==
"NULL"
]
;
do
echo
"Usage example: >/home/usr_name
\/
Desktop/"
read
-p
"
${
PROMPT
}
"
USER_INPUT
echo
-en
"
\0
33[1A
\0
33[2K"
echo
"Typed:
$USER_INPUT
"
done
sed
-i
"6s#.*#declare DIRECTORY=
\"
$USER_INPUT
\"
#"
tp_create.sh
echo
"Configuring done, please check if the directory you gave actually exists and is the correct one you wanna use before launching the script
\n
"
exit
0
This diff is collapsed.
Click to expand it.
tp_create.sh
0 → 100755
+
58
−
0
View file @
2b1fa2f2
#!/bin/bash
shopt
-s
-o
nounset
declare
TP_NAME
declare
DIRECTORY
=
""
if
test
$#
-lt
1
;
then
echo
"Usage:
$0
TP_NAME"
exit
-1
fi
TP_NAME
=
$1
cd
$DIRECTORY
if
[[
"
$TP_NAME
"
=
~
(
|
\'
)
]]
;
then
echo
"TP_NAME should not contain spaces"
exit
-2
fi
if
test
-d
"
$TP_NAME
"
;
then
echo
"DIRECTORY already exists, please choose another name"
exit
-4
fi
mkdir
$TP_NAME
if
test
!
-d
"
$TP_NAME
"
;
then
echo
"mkdir creation failed, aborting..."
exit
-3
fi
cd
"
$TP_NAME
"
git init
touch
"Makefile"
echo
-e
"CFLAGS:=-g -Wall -Wextra -fsanitize=address -fsanitize=leak -std=gnu11
\n
#linker flags
\n
LDFLAGS:=-lm -lSDL2 -fsanitize=address
\n\n
FNAME:=
$TP_NAME
\n\n
${
TP_NAME
}
:
${
TP_NAME
}
.c
${
TP_NAME
}
.h main.o
\n
\t
\$
(CC) -o
\$
@
\$
^
\$
(LDFLAGS)
\n\t
./
$TP_NAME
\n
clean:
\n\t
@rm -f *.o
$TP_NAME
"
>
Makefile
touch
"main.c"
echo
-e
"#include
\"
${
TP_NAME
}
.h
\"\n\n
int main(void){
\n
}"
>
main.c
touch
"
${
TP_NAME
}
.c"
touch
"
${
TP_NAME
}
.h"
echo
-e
"#ifndef _
${
TP_NAME
^^
}
_H_
\n
#define _
${
TP_NAME
^^
}
_H_
\n
#include <stdio.h>
\n
#include <stdlib.h>
\n
#include <stdbool.h>
\n\n
#endif"
>
"
${
TP_NAME
}
.h"
pwd
echo
$(
git remote add origin ssh://git@ssh.hesge.ch:10572/ricardo.dossanto1/
${
TP_NAME
}
)
echo
$(
git add .
)
echo
$(
git commit
-m
"Auto commit generation via script"
)
echo
$(
git push
-u
origin master
)
#cd "/home/ricky/Desktop/"
#rm -r $TP_NAME
exit
0
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