mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2025-02-22 16:01:04 -05:00
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:
commit
3897b689c2
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