From 3c7355f3336fdeca61740224d1d85331e2d97b2c Mon Sep 17 00:00:00 2001 From: Ruud Senden <8635138+rsenden@users.noreply.github.com> Date: Tue, 23 Jan 2024 00:47:24 +0100 Subject: [PATCH] chore: Add support for global bin scripts --- .../fortify/cli/common/util/FileUtils.java | 11 +++--- .../cli/cmd/AbstractToolInstallCommand.java | 34 +++++++++++++++++-- .../tool/_common/helper/ToolInstaller.java | 3 +- .../ToolBugTrackerUtilityInstallCommand.java | 9 +++-- .../cmd/ToolDebrickedCliInstallCommand.java | 2 ++ .../fcli/cli/cmd/ToolFcliInstallCommand.java | 10 ++++-- .../cmd/ToolFoDUploaderInstallCommand.java | 12 +++---- .../cli/cmd/ToolSCClientInstallCommand.java | 3 +- .../cmd/ToolVulnExporterInstallCommand.java | 12 +++---- .../global_bin/FortifyBugTrackerUtility | 2 ++ .../global_bin/FortifyBugTrackerUtility.bat | 1 + .../extra-files/global_bin/debricked | 2 ++ .../extra-files/global_bin/debricked.bat | 1 + .../tool/fcli/extra-files/{ => jar}/bin/fcli | 0 .../fcli/extra-files/{ => jar}/bin/fcli.bat | 0 .../tool/fcli/extra-files/jar/global_bin/fcli | 2 ++ .../fcli/extra-files/jar/global_bin/fcli.bat | 1 + .../fcli/extra-files/native/global_bin/fcli | 2 ++ .../extra-files/native/global_bin/fcli.bat | 1 + .../extra-files/global_bin/FoDUpload | 2 ++ .../extra-files/global_bin/FoDUpload.bat | 1 + .../extra-files/global_bin/scancentral | 2 ++ .../extra-files/global_bin/scancentral.bat | 1 + .../global_bin/FortifyVulnerabilityExporter | 2 ++ .../FortifyVulnerabilityExporter.bat | 1 + 25 files changed, 83 insertions(+), 34 deletions(-) create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility.bat create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked.bat rename fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/{ => jar}/bin/fcli (100%) rename fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/{ => jar}/bin/fcli.bat (100%) create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli.bat create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli.bat create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload.bat create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral.bat create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter.bat diff --git a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/util/FileUtils.java b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/util/FileUtils.java index 650bd7bd9d..7efdb5079b 100644 --- a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/util/FileUtils.java +++ b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/util/FileUtils.java @@ -42,6 +42,12 @@ public static final InputStream getResourceInputStream(String resourcePath) { } public static final void copyResource(String resourcePath, Path destinationFilePath, CopyOption... options) { + var parent = destinationFilePath.getParent(); + try { + Files.createDirectories(parent); + } catch (IOException e) { + throw new RuntimeException(String.format("Error creating directory %s", parent), e); + } try ( InputStream in = getResourceInputStream(resourcePath) ) { Files.copy( in, destinationFilePath, options); } catch ( IOException e ) { @@ -50,11 +56,6 @@ public static final void copyResource(String resourcePath, Path destinationFileP } public static final void copyResourceToDir(String resourcePath, Path destinationPath, CopyOption... options) { - try { - Files.createDirectories(destinationPath); - } catch (IOException e) { - throw new RuntimeException(String.format("Error creating directory %s", destinationPath), e); - } String fileName = Paths.get(resourcePath).getFileName().toString(); copyResource(resourcePath, destinationPath.resolve(fileName), options); } diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolInstallCommand.java index d2fe30984d..d25b1c4892 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolInstallCommand.java @@ -15,6 +15,7 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.util.LinkedHashMap; import java.util.Map; import java.util.function.Consumer; @@ -82,6 +83,29 @@ public final boolean isSingular() { protected abstract void postInstall(ToolInstallationResult installationResult); protected abstract String getDefaultArtifactType(); + protected final void copyBinResource(ToolInstallationResult installationResult, String resourceFile) { + var fullResourceFile = getFullResourceFile(installationResult, resourceFile); + FileUtils.copyResourceToDir(fullResourceFile, installationResult.getInstallationDescriptor().getBinPath(), StandardCopyOption.REPLACE_EXISTING); + } + + @SneakyThrows + protected final void copyGlobalBinResource(ToolInstallationResult installationResult, String resourceFile) { + if ( installDir==null ) { + // We only install global bin scripts if no explicit tool installation directory was specified + var fullResourceFile = getFullResourceFile(installationResult, resourceFile); + var destFilePath = getBasePath().resolve("bin").resolve(Path.of(resourceFile).getFileName()); + FileUtils.copyResource(fullResourceFile, destFilePath, StandardCopyOption.REPLACE_EXISTING); + String content = new String(Files.readAllBytes(destFilePath), "ASCII"); + content = content.replace("{{binDir}}", installationResult.getInstallationDescriptor().getBinDir()); + Files.write(destFilePath, content.getBytes("ASCII")); + ToolInstaller.updateFilePermissions(destFilePath); + } + } + + private String getFullResourceFile(ToolInstallationResult installationResult, String resourceFile) { + return String.format("com/fortify/cli/tool/%s/%s", installationResult.getToolName().replace("-", "_"), resourceFile); + } + private final ArrayNode install() { try ( var progressWriter = progressWriterFactory.create() ) { var preparer = new ToolInstallationPreparer(); @@ -109,13 +133,17 @@ private final Path getTargetPath(ToolInstaller toolInstaller) { toolInstaller.getProgressWriter().writeWarning("WARN: --install-dir option is deprecated"); result = this.installDir.toPath(); } else { - var basePath = this.baseDir!=null - ? this.baseDir.toPath() - : Path.of(System.getProperty("user.home"),"fortify", "tools"); + var basePath = getBasePath(); result = basePath.resolve(String.format("%s/%s", getToolName(), toolInstaller.getToolVersion())); } return result.normalize().toAbsolutePath(); } + + private Path getBasePath() { + return this.baseDir!=null + ? this.baseDir.toPath() + : Path.of(System.getProperty("user.home"),"fortify", "tools"); + } private final class ToolInstallationPreparer implements Consumer { @Getter private final ArrayNode toolInstallationOutputDescriptors = OBJECTMAPPER.createArrayNode(); diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolInstaller.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolInstaller.java index 7b066920c8..b350866690 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolInstaller.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolInstaller.java @@ -188,8 +188,9 @@ private static final void updateBinPermissions(Path binPath) throws IOException } } + // TODO Move this method to FileUtils or similar, as it's also used by AbstractToolInstallCommand @SneakyThrows - private static final void updateFilePermissions(Path p) { + public static final void updateFilePermissions(Path p) { try { Files.setPosixFilePermissions(p, binPermissions); } catch ( UnsupportedOperationException e ) { diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java index 957f66b1e4..324b5a1ad6 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java @@ -15,9 +15,7 @@ import java.nio.file.Files; import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; -import com.fortify.cli.common.util.FileUtils; import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; -import com.fortify.cli.tool._common.helper.ToolInstallationHelper; import com.fortify.cli.tool._common.helper.ToolInstaller.ToolInstallationResult; import lombok.Getter; @@ -38,9 +36,10 @@ protected String getDefaultArtifactType() { @Override @SneakyThrows protected void postInstall(ToolInstallationResult installationResult) { var installationDescriptor = installationResult.getInstallationDescriptor(); - var binPath = installationDescriptor.getBinPath(); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility"), binPath); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility.bat"), binPath); + copyBinResource(installationResult, "extra-files/bin/FortifyBugTrackerUtility"); + copyBinResource(installationResult, "extra-files/bin/FortifyBugTrackerUtility.bat"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FortifyBugTrackerUtility"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FortifyBugTrackerUtility.bat"); var jarFiles = Files.find(installationDescriptor.getInstallPath(), 1, (p,a)->p.toFile().getName().matches("FortifyBugTrackerUtility.*\\.jar")) diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/debricked_cli/cli/cmd/ToolDebrickedCliInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/debricked_cli/cli/cmd/ToolDebrickedCliInstallCommand.java index f04a31e9c3..3ade600a35 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/debricked_cli/cli/cmd/ToolDebrickedCliInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/debricked_cli/cli/cmd/ToolDebrickedCliInstallCommand.java @@ -40,5 +40,7 @@ protected void postInstall(ToolInstallationResult installationResult) { Path installPath = installationDescriptor.getInstallPath(); Path binPath = installationDescriptor.getBinPath(); FileUtils.moveFiles(installPath, binPath, "debricked(\\.exe)?"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/debricked"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/debricked.bat"); } } diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fcli/cli/cmd/ToolFcliInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fcli/cli/cmd/ToolFcliInstallCommand.java index 2e12599d0c..c500cebc28 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fcli/cli/cmd/ToolFcliInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fcli/cli/cmd/ToolFcliInstallCommand.java @@ -18,7 +18,6 @@ import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; import com.fortify.cli.common.util.FileUtils; import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; -import com.fortify.cli.tool._common.helper.ToolInstallationHelper; import com.fortify.cli.tool._common.helper.ToolInstaller.ToolInstallationResult; import lombok.Getter; @@ -43,8 +42,13 @@ protected void postInstall(ToolInstallationResult installationResult) { Path binPath = installationDescriptor.getBinPath(); FileUtils.moveFiles(installPath, binPath, "fcli(_completion)?(\\.exe)?"); if ( Files.exists(installPath.resolve("fcli.jar")) ) { - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/fcli"), binPath); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/fcli.bat"), binPath); + copyBinResource(installationResult, "extra-files/jar/bin/fcli"); + copyBinResource(installationResult, "extra-files/jar/bin/fcli.bat"); + copyGlobalBinResource(installationResult, "extra-files/jar/global_bin/fcli"); + copyGlobalBinResource(installationResult, "extra-files/jar/global_bin/fcli.bat"); + } else { + copyGlobalBinResource(installationResult, "extra-files/native/global_bin/fcli"); + copyGlobalBinResource(installationResult, "extra-files/native/global_bin/fcli.bat"); } } } diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fod_uploader/cli/cmd/ToolFoDUploaderInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fod_uploader/cli/cmd/ToolFoDUploaderInstallCommand.java index 6285baa827..12e1751f56 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fod_uploader/cli/cmd/ToolFoDUploaderInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/fod_uploader/cli/cmd/ToolFoDUploaderInstallCommand.java @@ -12,12 +12,8 @@ *******************************************************************************/ package com.fortify.cli.tool.fod_uploader.cli.cmd; -import java.nio.file.Path; - import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; -import com.fortify.cli.common.util.FileUtils; import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; -import com.fortify.cli.tool._common.helper.ToolInstallationHelper; import com.fortify.cli.tool._common.helper.ToolInstaller.ToolInstallationResult; import lombok.Getter; @@ -37,9 +33,9 @@ protected String getDefaultArtifactType() { @Override @SneakyThrows protected void postInstall(ToolInstallationResult installationResult) { - var installationDescriptor = installationResult.getInstallationDescriptor(); - Path binPath = installationDescriptor.getBinPath(); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FoDUpload"), binPath); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FoDUpload.bat"), binPath); + copyBinResource(installationResult, "extra-files/bin/FoDUpload"); + copyBinResource(installationResult, "extra-files/bin/FoDUpload.bat"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FoDUpload"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FoDUpload.bat"); } } diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/sc_client/cli/cmd/ToolSCClientInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/sc_client/cli/cmd/ToolSCClientInstallCommand.java index 67cc85e4ac..3467e265fe 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/sc_client/cli/cmd/ToolSCClientInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/sc_client/cli/cmd/ToolSCClientInstallCommand.java @@ -43,8 +43,9 @@ protected String getDefaultArtifactType() { @Override @SneakyThrows protected void postInstall(ToolInstallationResult installationResult) { var installationDescriptor = installationResult.getInstallationDescriptor(); - // Updating bin permissions is handled by parent class updateClientAuthToken(installationDescriptor.getInstallPath()); + copyGlobalBinResource(installationResult, "extra-files/global_bin/scancentral"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/scancentral.bat"); } private void updateClientAuthToken(Path installPath) throws IOException { diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/vuln_exporter/cli/cmd/ToolVulnExporterInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/vuln_exporter/cli/cmd/ToolVulnExporterInstallCommand.java index 2f0d3b5470..f1d4913ca5 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/vuln_exporter/cli/cmd/ToolVulnExporterInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/vuln_exporter/cli/cmd/ToolVulnExporterInstallCommand.java @@ -12,12 +12,8 @@ *******************************************************************************/ package com.fortify.cli.tool.vuln_exporter.cli.cmd; -import java.nio.file.Path; - import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; -import com.fortify.cli.common.util.FileUtils; import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; -import com.fortify.cli.tool._common.helper.ToolInstallationHelper; import com.fortify.cli.tool._common.helper.ToolInstaller.ToolInstallationResult; import lombok.Getter; @@ -37,9 +33,9 @@ protected String getDefaultArtifactType() { @Override @SneakyThrows protected void postInstall(ToolInstallationResult installationResult) { - var installationDescriptor = installationResult.getInstallationDescriptor(); - Path binPath = installationDescriptor.getBinPath(); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FortifyVulnerabilityExporter"), binPath); - FileUtils.copyResourceToDir(ToolInstallationHelper.getToolResourceFile(getToolName(), "extra-files/bin/FortifyVulnerabilityExporter.bat"), binPath); + copyBinResource(installationResult, "extra-files/bin/FortifyVulnerabilityExporter"); + copyBinResource(installationResult, "extra-files/bin/FortifyVulnerabilityExporter.bat"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FortifyVulnerabilityExporter"); + copyGlobalBinResource(installationResult, "extra-files/global_bin/FortifyVulnerabilityExporter.bat"); } } diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility new file mode 100644 index 0000000000..e770094bdc --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/FortifyBugTrackerUtility "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility.bat new file mode 100644 index 0000000000..acdd4d2954 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker_utility/extra-files/global_bin/FortifyBugTrackerUtility.bat @@ -0,0 +1 @@ +{{binDir}}\FortifyBugTrackerUtility.bat %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked new file mode 100644 index 0000000000..6601ac992b --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/debricked "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked.bat new file mode 100644 index 0000000000..df0877d75f --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/debricked_cli/extra-files/global_bin/debricked.bat @@ -0,0 +1 @@ +{{binDir}}\debricked.exe %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/bin/fcli b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/bin/fcli similarity index 100% rename from fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/bin/fcli rename to fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/bin/fcli diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/bin/fcli.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/bin/fcli.bat similarity index 100% rename from fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/bin/fcli.bat rename to fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/bin/fcli.bat diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli new file mode 100644 index 0000000000..a0f6ee8bc4 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/fcli "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli.bat new file mode 100644 index 0000000000..7e14823d22 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/jar/global_bin/fcli.bat @@ -0,0 +1 @@ +{{binDir}}\fcli.bat %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli new file mode 100644 index 0000000000..a0f6ee8bc4 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/fcli "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli.bat new file mode 100644 index 0000000000..50323686b2 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fcli/extra-files/native/global_bin/fcli.bat @@ -0,0 +1 @@ +{{binDir}}\fcli.exe %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload new file mode 100644 index 0000000000..f34f42a9f2 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/FoDUpload "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload.bat new file mode 100644 index 0000000000..dc39f8cd4a --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod_uploader/extra-files/global_bin/FoDUpload.bat @@ -0,0 +1 @@ +{{binDir}}\FoDUpload.bat %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral new file mode 100644 index 0000000000..7716e8f97e --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/scancentral "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral.bat new file mode 100644 index 0000000000..2067571772 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc_client/extra-files/global_bin/scancentral.bat @@ -0,0 +1 @@ +{{binDir}}\scancentral.bat %* \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter new file mode 100644 index 0000000000..88973ec19b --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter @@ -0,0 +1,2 @@ +#!/bin/bash +{{binDir}}/FortifyVulnerabilityExporter "$@" \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter.bat b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter.bat new file mode 100644 index 0000000000..41e102303d --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln_exporter/extra-files/global_bin/FortifyVulnerabilityExporter.bat @@ -0,0 +1 @@ +{{binDir}}\FortifyVulnerabilityExporter.bat %* \ No newline at end of file