Skip to content

Commit f7d46e1

Browse files
committed
x
1 parent e6fc945 commit f7d46e1

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

.github/workflows/shell-tests.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,31 @@ jobs:
149149

150150
- name: Find and Extract OpenNLP Distribution
151151
run: |
152-
# Find the first non-src .tar.gz file in the target directory
153-
$TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1
154-
155-
# Ensure we found a file
156-
if (-not $TAR_FILE) {
157-
Write-Error "Error: No matching tar.gz file found in opennlp-distr/target"
158-
exit 1
159-
}
160-
161-
# Extract the tar.gz file to the user profile directory
162-
$Destination = "$env:USERPROFILE"
163-
tar -xzf $TAR_FILE.FullName -C $Destination
164-
165-
# Get the directory name of the extracted content (excluding the tar path)
166-
$EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0]
167-
168-
# Set OPENNLP_HOME dynamically in the environment
169-
Write-Host "OPENNLP_HOME=$env:USERPROFILE\$EXTRACTED_DIR" # Debugging
170-
echo "OPENNLP_HOME=$env:USERPROFILE\$EXTRACTED_DIR" >> $GITHUB_ENV
171-
echo "$env:USERPROFILE\$EXTRACTED_DIR\bin" >> $GITHUB_PATH
152+
- name: Find and Extract OpenNLP Distribution
153+
run: |
154+
# Find the first non-src .tar.gz file in the target directory
155+
$TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1
156+
157+
# Ensure we found a file
158+
if (-not $TAR_FILE) {
159+
Write-Error "Error: No matching tar.gz file found in opennlp-distr/target"
160+
exit 1
161+
}
162+
163+
# Extract the tar.gz file to the user profile directory
164+
$Destination = "$env:USERPROFILE"
165+
tar -xzf $TAR_FILE.FullName -C $Destination
166+
167+
# Get the directory name of the extracted content (excluding the tar path)
168+
$EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0]
169+
170+
# Set OPENNLP_HOME dynamically in the environment
171+
$OPENNLP_HOME_PATH = "$env:USERPROFILE\$EXTRACTED_DIR"
172+
Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging
173+
174+
# Set the environment variable for future steps
175+
echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV
176+
echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH
172177

173178
- name: Verify Extraction
174179
run: |

0 commit comments

Comments
 (0)