You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB

  1. #!/bin/bash
  2. export SDATA=$(echo $SNAP_DATA | sed "s|$SNAP_REVISION|current|")
  3. export SCOMMON="$SNAP_COMMON"
  4. export isRoot=`true`
  5. snapctl set gitea.snap.workdir="$SDATA/custom"
  6. snapctl set gitea.snap.custom="$SCOMMON"
  7. function mkDirCommon(){
  8. for dir in $@; do
  9. mkdir -p "$SCOMMON/$dir"
  10. done
  11. }
  12. function mkdirData(){
  13. for dir in $@; do
  14. mkdir -p "$SDATA/$dir"
  15. if [ -d $SNAP/$dir ]; then
  16. cp -r --preserve=mode \
  17. $SNAP/$dir/* \
  18. $SNAP/$dir/.[a-zA-Z0-9-]* \
  19. $SDATA/$dir/ 2> $SCOMMON/log/snap-mkdirData.log
  20. fi
  21. done
  22. }
  23. mkDirCommon pictures \
  24. repositories \
  25. attachments \
  26. data \
  27. log
  28. mkdirData certs \
  29. sshkeytest \
  30. custom/conf \
  31. static/templates \
  32. static/scripts \
  33. static/public
  34. [[ -f $SNAP_COMMON/conf/app.ini ]] || $SNAP/bin/gconfig install
  35. # Configure Git to use the right templates
  36. mkdir -p $SDATA/git/
  37. cp -r --preserve=mode $SNAP/usr/share/git-core/templates $SDATA/git/
  38. $SNAP/usr/bin/git config --global init.templateDir $SDATA/git/templates/