Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed Jan 17, 2025
1 parent f7d46e1 commit 995060e
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/shell-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,29 @@ jobs:
run: |
- name: Find and Extract OpenNLP Distribution
run: |
# Find the first non-src .tar.gz file in the target directory
$TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1

# Ensure we found a file
if (-not $TAR_FILE) {
Write-Error "Error: No matching tar.gz file found in opennlp-distr/target"
exit 1
}

# Extract the tar.gz file to the user profile directory
$Destination = "$env:USERPROFILE"
tar -xzf $TAR_FILE.FullName -C $Destination

# Get the directory name of the extracted content (excluding the tar path)
$EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0]

# Set OPENNLP_HOME dynamically in the environment
$OPENNLP_HOME_PATH = "$env:USERPROFILE\$EXTRACTED_DIR"
Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging

# Set the environment variable for future steps
echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV
echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH
# Find the first non-src .tar.gz file in the target directory
$TAR_FILE = Get-ChildItem -Path opennlp-distr/target -Filter "*.tar.gz" | Where-Object { $_.Name -notlike "*-src*" } | Select-Object -First 1
# Ensure we found a file
if (-not $TAR_FILE) {
Write-Error "Error: No matching tar.gz file found in opennlp-distr/target"
exit 1
}
# Extract the tar.gz file to the user profile directory
$Destination = "$env:USERPROFILE"
tar -xzf $TAR_FILE.FullName -C $Destination
# Get the directory name of the extracted content (excluding the tar path)
$EXTRACTED_DIR = (tar -tf $TAR_FILE.FullName | Select-Object -First 1).Split('/')[0]
# Set OPENNLP_HOME dynamically in the environment
$OPENNLP_HOME_PATH = "$env:USERPROFILE\$EXTRACTED_DIR"
Write-Host "OPENNLP_HOME=$OPENNLP_HOME_PATH" # Debugging
# Set the environment variable for future steps
echo "OPENNLP_HOME=$OPENNLP_HOME_PATH" >> $GITHUB_ENV
echo "$OPENNLP_HOME_PATH\bin" >> $GITHUB_PATH

- name: Verify Extraction
run: |
Expand Down

0 comments on commit 995060e

Please sign in to comment.