File: qmlformat.sh

package info (click to toggle)
easyeffects 8.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,272 kB
  • sloc: cpp: 23,767; sh: 691; python: 448; javascript: 64; makefile: 8
file content (21 lines) | stat: -rwxr-xr-x 699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash

set -euo pipefail

if [[ ! -f .qmlformat.ini ]]; then
    echo "ERROR: Run this in the root directory of the repository where the .qmlformat.ini file is"
    exit 1
fi

# unlike qmllint, this can also be used on js files, not just qml files, so glob everything in the directory

# for some reason the arch qt6-declarative package doesn't add this to the normally searched directories
if [[ -f /usr/lib/qt6/bin/qmlformat ]]; then
    /usr/lib/qt6/bin/qmlformat src/contents/ui/* --inplace "$@"
# for fedora
elif command -v qmlformat-qt6 --help &>/dev/null; then
    qmlformat-qt6 src/contents/ui/* --inplace "$@"
else
    echo "ERROR: Could not find qmlformat qt6"
    exit 1
fi