Skip to content

Commit 8540392

Browse files
committed
chore: Standardize indent
1 parent 9964972 commit 8540392

4 files changed

Lines changed: 66 additions & 53 deletions

File tree

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{sh,zsh}]
10+
indent_size = 4
11+
12+
[Makefile]
13+
indent_style = tabs

aur/PKGBUILD

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,50 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/andrewferrier/memy/archive/
1212
sha256sums=('ca46b47a06fd094ac20e2d881066fee9b5fe9f9470a05460bc8ffa76e22e1fe1')
1313

1414
prepare() {
15-
cd "$srcdir/$pkgname-$pkgver"
16-
export RUSTUP_TOOLCHAIN=stable
17-
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
15+
cd "$srcdir/$pkgname-$pkgver"
16+
export RUSTUP_TOOLCHAIN=stable
17+
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
1818
}
1919

2020
build() {
21-
cd "$srcdir/$pkgname-$pkgver"
22-
export RUSTUP_TOOLCHAIN=stable
23-
export CARGO_TARGET_DIR=target
24-
# Strip GCC LTO flags: the bundled SQLite is compiled via the cc crate using
25-
# CFLAGS, producing GCC GIMPLE IR. Arch's Rust uses lld, which cannot read
26-
# GCC LTO IR, causing undefined symbol errors at link time.
27-
CFLAGS="${CFLAGS//-flto*/}"
28-
cargo build --frozen --release
21+
cd "$srcdir/$pkgname-$pkgver"
22+
export RUSTUP_TOOLCHAIN=stable
23+
export CARGO_TARGET_DIR=target
24+
# Strip GCC LTO flags: the bundled SQLite is compiled via the cc crate using
25+
# CFLAGS, producing GCC GIMPLE IR. Arch's Rust uses lld, which cannot read
26+
# GCC LTO IR, causing undefined symbol errors at link time.
27+
CFLAGS="${CFLAGS//-flto*/}"
28+
cargo build --frozen --release
2929
}
3030

3131
check() {
32-
cd "$srcdir/$pkgname-$pkgver"
33-
export RUSTUP_TOOLCHAIN=stable
34-
export CARGO_TARGET_DIR=target
35-
cargo test --frozen
32+
cd "$srcdir/$pkgname-$pkgver"
33+
export RUSTUP_TOOLCHAIN=stable
34+
export CARGO_TARGET_DIR=target
35+
cargo test --frozen
3636
}
3737

3838
package() {
39-
cd "$srcdir/$pkgname-$pkgver"
39+
cd "$srcdir/$pkgname-$pkgver"
4040

41-
install -Dm755 target/release/memy -t "$pkgdir/usr/bin/"
41+
install -Dm755 target/release/memy -t "$pkgdir/usr/bin/"
4242

43-
install -Dm644 target/man/*.1 -t "$pkgdir/usr/share/man/man1/"
44-
install -Dm644 target/man/memy.toml.5 -t "$pkgdir/usr/share/man/man5/"
43+
install -Dm644 target/man/*.1 -t "$pkgdir/usr/share/man/man1/"
44+
install -Dm644 target/man/memy.toml.5 -t "$pkgdir/usr/share/man/man5/"
4545

46-
install -Dm644 target/completions/memy.bash \
47-
"$pkgdir/usr/share/bash-completion/completions/memy"
48-
install -Dm644 target/completions/_memy \
49-
"$pkgdir/usr/share/zsh/site-functions/_memy"
50-
install -Dm644 target/completions/memy.fish \
51-
"$pkgdir/usr/share/fish/vendor_completions.d/memy.fish"
46+
install -Dm644 target/completions/memy.bash \
47+
"$pkgdir/usr/share/bash-completion/completions/memy"
48+
install -Dm644 target/completions/_memy \
49+
"$pkgdir/usr/share/zsh/site-functions/_memy"
50+
install -Dm644 target/completions/memy.fish \
51+
"$pkgdir/usr/share/fish/vendor_completions.d/memy.fish"
5252

53-
install -Dm644 -t "$pkgdir/usr/share/memy/hooks/" hooks/*
53+
install -Dm644 -t "$pkgdir/usr/share/memy/hooks/" hooks/*
5454

55-
install -Dm644 config/template-memy.toml \
56-
"$pkgdir/usr/share/memy/template-memy.toml"
55+
install -Dm644 config/template-memy.toml \
56+
"$pkgdir/usr/share/memy/template-memy.toml"
5757

58-
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
58+
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
5959

60-
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
60+
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
6161
}

install.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ BIN_NAME="memy"
99

1010
echo "Fetching latest release version..." >&2
1111
VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" |
12-
grep '"tag_name":' |
13-
head -n 1 |
14-
sed -E 's/.*"([^"]+)".*/\1/') || {
15-
echo "Error: Failed to fetch latest release version. Exiting." >&2
16-
exit 1
12+
grep '"tag_name":' |
13+
head -n 1 |
14+
sed -E 's/.*"([^"]+)".*/\1/') || {
15+
echo "Error: Failed to fetch latest release version. Exiting." >&2
16+
exit 1
1717
}
1818

1919
if [ -z "$VERSION" ]; then
20-
echo "Error: Could not determine latest release version. Exiting." >&2
21-
exit 1
20+
echo "Error: Could not determine latest release version. Exiting." >&2
21+
exit 1
2222
fi
2323

2424
OS=$(uname | tr '[:upper:]' '[:lower:]')
@@ -28,18 +28,18 @@ case "$OS" in
2828
linux) OS="linux" ;;
2929
darwin) OS="macos" ;;
3030
*)
31-
echo "Error: Unsupported OS: $OS. Exiting." >&2
32-
exit 1
33-
;;
31+
echo "Error: Unsupported OS: $OS. Exiting." >&2
32+
exit 1
33+
;;
3434
esac
3535

3636
case "$ARCH" in
3737
x86_64) ARCH="x86_64" ;;
3838
aarch64 | arm64) ARCH="aarch64" ;;
3939
*)
40-
echo "Error: Unsupported architecture: $ARCH. Exiting." >&2
41-
exit 1
42-
;;
40+
echo "Error: Unsupported architecture: $ARCH. Exiting." >&2
41+
exit 1
42+
;;
4343
esac
4444

4545
URL="https://github.com/$REPO/releases/download/$VERSION/${BIN_NAME}-${OS}-${ARCH}"
@@ -49,27 +49,27 @@ TARGET_BIN_PATH="$DEST/$BIN_NAME"
4949
mkdir -p "$DEST"
5050

5151
if [ -f "$TARGET_BIN_PATH" ]; then
52-
echo "memy is already installed. If you wish to download it freshly/upgrade it, please delete $TARGET_BIN_PATH first."
53-
exit 1
52+
echo "memy is already installed. If you wish to download it freshly/upgrade it, please delete $TARGET_BIN_PATH first."
53+
exit 1
5454
fi
5555

5656
DOWNLOAD_TMP=$(mktemp -d) || {
57-
echo "Error: Failed to create temporary directory. Exiting." >&2
58-
exit 1
57+
echo "Error: Failed to create temporary directory. Exiting." >&2
58+
exit 1
5959
}
6060

6161
echo "Downloading $BIN_NAME..." >&2
6262

6363
curl --fail -L "$URL" -o "${DOWNLOAD_TMP}/${BIN_NAME}" || {
64-
echo "Error: Failed to download $BIN_NAME from $URL. Exiting." >&2
65-
exit 1
64+
echo "Error: Failed to download $BIN_NAME from $URL. Exiting." >&2
65+
exit 1
6666
}
6767

6868
mv "$DOWNLOAD_TMP/$BIN_NAME" "$TARGET_BIN_PATH"
6969
chmod +x "$TARGET_BIN_PATH"
7070

7171
if ! "$TARGET_BIN_PATH" --version >/dev/null 2>&1; then
72-
echo "Warning: Installed binary failed to run. It may not be compatible with your system." >&2
72+
echo "Warning: Installed binary failed to run. It may not be compatible with your system." >&2
7373
fi
7474

7575
echo "Installed $BIN_NAME to $TARGET_BIN_PATH"

memy.plugin.zsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if (( $+commands[memy] )); then
2-
eval "$(memy hook zsh)"
1+
if (($+commands[memy])); then
2+
eval "$(memy hook zsh)"
33
else
4-
echo 'memy: command not found, please install it from https://github.com/andrewferrier/memy'
4+
echo 'memy: command not found, please install it from https://github.com/andrewferrier/memy'
55
fi

0 commit comments

Comments
 (0)