-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from hydephp/add-root-directory-path-option
Add root directory path option
- Loading branch information
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# If the directory input is not the root directory, we replace the current working directory files with the directory | ||
# input files. This way is more reliable, as GitHub does not support setting a working directory on a job level. | ||
|
||
# Get directory from CLI input | ||
directory=$1 | ||
|
||
if [ "$directory" != "." ]; then | ||
# Create a temporary directory outside of the current working directory. | ||
mkdir ../tmp | ||
# Copy the directory input files recursively to the temporary directory. | ||
cp -r "$directory"/* ../tmp | ||
# Remove the current working directory files. | ||
rm -rf ./* | ||
# Copy the temporary directory files to the current working directory. | ||
cp -r ../tmp/* . | ||
|
||
# Remove the temporary directory. | ||
rm -rf ../tmp | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters