Merge pull request 'chore(cleanup): shfmt and .editorconfig applied to all scripts' (#296) from earl-warren/setup-forgejo:wip-shfmt into main

Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/296
This commit is contained in:
earl-warren 2025-01-28 20:40:36 +00:00
commit 3897b689c2
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: F128CBE6AB3A7201
7 changed files with 151 additions and 141 deletions

10
.editorconfig Normal file
View 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

View file

@ -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

View file

@ -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() {