Setup SigTerm Project
This commit is contained in:
commit
b827361e75
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
bin
|
7
.gitpod.yml
Normal file
7
.gitpod.yml
Normal file
@ -0,0 +1,7 @@
|
||||
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
|
||||
tasks:
|
||||
- init: sh ./coauthors.sh
|
||||
vscode:
|
||||
extensions:
|
||||
- redhat.java
|
||||
- mhutchie.git-graph
|
BIN
SigTerm.jar
Normal file
BIN
SigTerm.jar
Normal file
Binary file not shown.
40
coauthors.sh
Executable file
40
coauthors.sh
Executable file
@ -0,0 +1,40 @@
|
||||
npm i -g git-mob
|
||||
cat <<-EOF > ~/.git-coauthors
|
||||
{
|
||||
"coauthors": {
|
||||
"sig": {
|
||||
"name": "sigonasr2",
|
||||
"email": "sigonasr2@gmail.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
git mob sig
|
||||
cat <<-EOF > .git/hooks/prepare-commit-msg
|
||||
#!/usr/bin/env node
|
||||
let exec = require('child_process').exec,
|
||||
fs = require('fs');
|
||||
const commitMessage = process.argv[2];
|
||||
// expect .git/COMMIT_EDITMSG
|
||||
if(/COMMIT_EDITMSG/g.test(commitMessage)){
|
||||
let contents = "";
|
||||
exec("git mob-print",
|
||||
function (err, stdout) {
|
||||
if(err) {
|
||||
process.exit(0);
|
||||
}
|
||||
// opens .git/COMMIT_EDITMSG
|
||||
contents = fs.readFileSync(commitMessage);
|
||||
if(contents.indexOf(stdout.trim()) !== -1) {
|
||||
process.exit(0);
|
||||
}
|
||||
const commentPos = contents.indexOf('# ');
|
||||
const gitMessage = contents.slice(0, commentPos);
|
||||
const gitComments = contents.slice(commentPos)
|
||||
fs.writeFileSync(commitMessage, gitMessage + stdout + gitComments);
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
EOF
|
||||
chmod +x .git/hooks/prepare-commit-msg
|
||||
echo "Environment is setup!"
|
5
run
Executable file
5
run
Executable file
@ -0,0 +1,5 @@
|
||||
javac --release 8 src/sig/*.java -d bin
|
||||
cd bin
|
||||
jar cfe ../SigTerm.jar sig.SigTerm sig
|
||||
cd ..
|
||||
java -cp bin sig/SigTerm
|
7
src/sig/SigTerm.java
Normal file
7
src/sig/SigTerm.java
Normal file
@ -0,0 +1,7 @@
|
||||
package sig;
|
||||
|
||||
public class SigTerm{
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user