Browse Source

cleanup

main
DarkFeather 2 years ago
parent
commit
3ed82f56bc
6 changed files with 19 additions and 6 deletions
  1. +3
    -0
      .gitignore
  2. +2
    -2
      Makefile
  3. +1
    -1
      PKGBUILD
  4. +1
    -1
      README.md
  5. +12
    -1
      aninixpb
  6. +0
    -1
      shae7eid.snip

+ 3
- 0
.gitignore View File

@ -1 +1,4 @@
*/__pycache__**
pkg/
*.tar.xz
src/

+ 2
- 2
Makefile View File

@ -1,9 +1,9 @@
prjname != basename `git config remote.origin.url` | sed 's/.git$$//'
compile: c cs java bash php perl python
compile:
@echo Done
install: clean
install: clean test
mkdir -p ${pkgdir}/opt/aninix/${prjname}/
rsync -avzp aninixpb ${pkgdir}/usr${prjname}/


+ 1
- 1
PKGBUILD View File

@ -5,7 +5,7 @@ pkgrel() {
git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit
}
epoch=
pkgdesc="$(head -n 1 README)"
pkgdesc="$(head -n 1 README.md)"
arch=("x86_64")
url="https://foundation.aninix.net/AniNIX/${pkgname}"
license=('custom')


+ 1
- 1
README.md View File

@ -17,7 +17,7 @@ Contributing
------
Please ensure you have the pre-commit hook established with the following before committing.
```
rm .git/hooks && ln -s ../hooks .git
rm -Rf .git/hooks && ln -s ../hooks .git
```
Feel free to send your patchfiles via DCC to an admin on ircs://aninix.net:6697/ or submit a pull request in AniNIX::Foundation.

+ 12
- 1
aninixpb View File

@ -25,15 +25,21 @@ function Usage() {
function SetupCheckout() {
### Setup the checkout
# Make everyone able to work the checkout directory.
if [ ! -d "$snipDir" ]; then
sudo mkdir "$snipDir"
sudo chmod 0777 "$snipDir"
git clone gitea@aninix.net:AniNIX/Snippets.git "$snipDir"
sudo chmod -R 1777 "$snipDir"
fi
# Fetch everything
git -C "$snipDir" fetch --all --prune
git -C "$snipDir" checkout master
git -C "$snipDir" reset --hard origin/master
# We need to suppress the reset on non-dryruns so that local testing can work.
if [ -z "$dryRun" ]; then
git -C "$snipDir" reset --hard origin/master
fi
# Get in sync
git -C "$snipDir" pull
}
@ -42,16 +48,21 @@ function NewSnip() {
### param stdin: read from stdin
# Choose the next snip as a random hash.
SetupCheckout
# Follow Git and use random strings instead of increments. Easier to avoid a collision and more performant.
nextSnip="${snipDir}/$(/usr/sbin/pwgen -A 8 1).snip"
# Pull stdin into the snippet
cat > "$nextSnip"
# Disable writes on dry runs
if [ -z "$dryRun" ]; then
# Add, commit, and push to publish the file.
git -C "$snipDir" add -A && git -C "$snipDir" commit -m "Adding $nextSnip via $0" && git -C "$snipDir" push origin master
# Inform the user if something went wrong.
if [ $? -ne 0 ]; then
echo Ran into a conflict with git. Please try again.
exit 2
fi
fi
# Provide a link
echo "New snippet created at https://foundation.aninix.net/AniNIX/Snippets/src/branch/master/$(basename "$nextSnip") from stdin"
}


+ 0
- 1
shae7eid.snip View File

@ -1 +0,0 @@
03:07:52 up 4:52, 1 user, load average: 1.45, 1.33, 1.23

Loading…
Cancel
Save