Skip to content

Commit

Permalink
Use top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Nov 3, 2024
1 parent 9ebbbd6 commit b76c11d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions bin/setup_ant.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion bin/setup_ant.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions src/cli.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import process from "node:process"
import {Release} from "./release.js"
import {Setup} from "./setup.js"

# Application entry point.
main = ->
try
process.title = "Setup Ant"

version = getInput "version"
Expand All @@ -16,6 +15,5 @@ main = ->
path = await new Setup(release).install {optionalTasks}
info "Apache Ant #{release.version} successfully #{installed} in \"#{path}\"."

# Start the application.
main().catch (error) ->
catch error
setFailed if error instanceof Error then error else String error
3 changes: 1 addition & 2 deletions src/setup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export class Setup
# Installs Apache Ant, after downloading it if required.
# Returns the path to the install directory.
install: (options = {}) ->
antHome = find("ant", @release.version)
if not antHome then antHome = await cacheDir (await @download options), "ant", @release.version
antHome = if directory = find("ant", @release.version) then directory else await cacheDir (await @download options), "ant", @release.version
addPath join antHome, "bin"
exportVariable "ANT_HOME", antHome
antHome
Expand Down

0 comments on commit b76c11d

Please sign in to comment.