From b726905c66050ac4229d53ce079a0bd05dbe900d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 30 Jan 2025 15:21:36 +0100 Subject: [PATCH 1/2] incus/file/pull: Ensure we have a leading / in all paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1614 Signed-off-by: Stéphane Graber --- cmd/incus/file.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/incus/file.go b/cmd/incus/file.go index a17486ad327..99467a0bfc5 100644 --- a/cmd/incus/file.go +++ b/cmd/incus/file.go @@ -575,6 +575,11 @@ func (c *cmdFilePull) Run(cmd *cobra.Command, args []string) error { return fmt.Errorf(i18n.G("Invalid source %s"), resource.name) } + // Make sure we have a leading / for the path. + if !strings.HasPrefix(pathSpec[1], "/") { + pathSpec[1] = "/" + pathSpec[1] + } + sftpConn, ok := sftpClients[pathSpec[0]] if !ok { sftpConn, err = resource.server.GetInstanceFileSFTP(pathSpec[0]) From 52acea96716481673759f80b49c505942ce3b553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 30 Jan 2025 15:30:48 +0100 Subject: [PATCH 2/2] github: Fix shellcheck MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 682ca724cb4..e6f9bd52f12 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Differential ShellCheck requires full git history + fetch-depth: 0 - name: Dependency Review uses: actions/dependency-review-action@v4