Merge pull request #1 from piersb/allow-files-with-spaces

Allow files with spaces
This commit is contained in:
Piers Beckley 2022-08-23 15:46:43 +01:00 committed by GitHub
commit 2c7db2f8dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 5 deletions

View File

@ -7,13 +7,19 @@ jobs:
steps:
- uses: actions/checkout@master
- name: copy file
uses: canastro/copy-file-action@master
uses: piersb/copy-file-action@allow-files-with-spaces
with:
source: "tests/a.txt"
target: "test-a.txt"
- name: copy file with args
uses: canastro/copy-file-action@master
uses: piersb/copy-file-action@allow-files-with-spaces
with:
source: "tests/a.txt"
target: "test-a.txt"
flags: "-f"
- name: copy file with args
uses: piersb/copy-file-action@allow-files-with-spaces
with:
source: "tests/path with spaces.txt"
target: "path-without-spaces.txt"

View File

@ -1,4 +1,4 @@
name: 'Copy file'
name: 'Copy file (with spaces)'
description: 'Copy local files'
author: 'Ricardo Canastro'
inputs:

View File

@ -1,3 +1,25 @@
#!/bin/sh -l
#!/bin/bash -l
cp $1 $2 $3
#bash -c "$(cp ' %q' "$@")"
echo "hello"
>&2 echo "test debug message"
time=$(date)
echo "::set-output name=time::$time"
ENV ARG_1=$1
ENV ARG_2=$2
ENV ARG_3=$3
echo $1 >> /tmp/logs.txt
echo $2 >> /tmp/logs.txt
echo $3 >> /tmp/logs.txt
echo >> /tmp/logs.txt "Receiving " $# " arguments"
echo "trying to run cp " "$2 " "$3"
#cp "$2" "$3"

0
test Normal file
View File

View File

@ -0,0 +1 @@
Test file for copying a file with spaces in its path