mirror of
https://code.forgejo.org/actions/setup-forgejo
synced 2025-03-14 22:27:01 +01:00
chore(cleanup): shfmt and .editorconfig applied to all scripts
This commit is contained in:
parent
7052de80f6
commit
b835e215bb
7 changed files with 151 additions and 141 deletions
10
.editorconfig
Normal file
10
.editorconfig
Normal file
|
@ -0,0 +1,10 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
|
@ -10,12 +10,6 @@ source $SELF_DIR/forgejo-lib.sh
|
|||
|
||||
if ${VERBOSE:-false}; then set -x; fi
|
||||
|
||||
function maybe_sudo() {
|
||||
if test $(id -u) != 0 ; then
|
||||
SUDO=sudo
|
||||
fi
|
||||
}
|
||||
|
||||
function ensure_user() {
|
||||
local user=$1
|
||||
|
||||
|
|
10
forgejo.sh
10
forgejo.sh
|
@ -63,8 +63,14 @@ function setup() {
|
|||
#
|
||||
# Redundant with forgejo-curl.sh, kept around for backward compatibility 09/2023
|
||||
#
|
||||
( echo -n 'Authorization: token ' ; cat $DIR/forgejo-token ) > $DIR/forgejo-header
|
||||
( echo "#!/bin/sh" ; echo 'curl -sS -H "Content-Type: application/json" -H @'$DIR/forgejo-header' "$@"' ) > $DIR/forgejo-api && chmod +x $DIR/forgejo-api
|
||||
(
|
||||
echo -n 'Authorization: token '
|
||||
cat $DIR/forgejo-token
|
||||
) >$DIR/forgejo-header
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo 'curl -sS -H "Content-Type: application/json" -H @'$DIR/forgejo-header' "$@"'
|
||||
) >$DIR/forgejo-api && chmod +x $DIR/forgejo-api
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
|
|
Loading…
Add table
Reference in a new issue