48 lines
1.4 KiB
Ruby
48 lines
1.4 KiB
Ruby
class Crowdin < Formula
|
|
desc "Command-line tool that allows to manage your resources with crowdin.com"
|
|
homepage "https://support.crowdin.com/cli-tool/"
|
|
url "https://github.com/crowdin/crowdin-cli/releases/download/3.6.5/crowdin-cli.zip"
|
|
sha256 "f5bc3ce5d15ace571b661c7f6d4a315b8888b30f91744dddf8ee428f739b6fb0"
|
|
license "MIT"
|
|
|
|
livecheck do
|
|
url "https://github.com/crowdin/crowdin-cli.git"
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "d7e36babd0fca84dc6f044fb7af2172920eff5efcc753ed24fc7077e367eeef3"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
libexec.install "crowdin-cli.jar"
|
|
bin.write_jar_script libexec/"crowdin-cli.jar", "crowdin"
|
|
end
|
|
|
|
test do
|
|
(testpath/"crowdin.yml").write <<~EOS
|
|
"project_id": "12"
|
|
"api_token": "54e01--your-personal-token--2724a"
|
|
"base_path": "."
|
|
"base_url": "https://api.crowdin.com" # https://{organization-name}.crowdin.com
|
|
|
|
"preserve_hierarchy": true
|
|
|
|
"files": [
|
|
{
|
|
"source" : "/t1/**/*",
|
|
"translation" : "/%two_letters_code%/%original_file_name%"
|
|
}
|
|
]
|
|
EOS
|
|
|
|
assert "Your configuration file looks good",
|
|
shell_output("#{bin}/crowdin lint")
|
|
|
|
assert "Failed to authorize in Crowdin",
|
|
shell_output("#{bin}/crowdin upload sources --config #{testpath}/crowdin.yml", 1)
|
|
end
|
|
end
|