Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Try to use a cached set of packages for Unit Testing
- name: Check for a FHIR package cache
id: cache-fhir-packages-test
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.fhir
key: cache-unit-test-fhir-packages-20250219
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:

# If there is no cache, save the downloaded packages
- name: Cache FHIR packages
uses: actions/cache/save@v4
uses: actions/cache/save@v5
if: ${{ steps.cache-fhir-packages-test.outputs.cache-hit != 'true' }}
continue-on-error: true
with:
Expand All @@ -65,12 +65,12 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

# Try to use a cached set of packages for Unit Testing
- name: Restore FHIR package cache
id: cache-fhir-packages
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.fhir
key: cache-unit-test-fhir-packages-20250219
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand All @@ -55,11 +55,11 @@ jobs:

- name: Configure Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/configure-pages@v5
uses: actions/configure-pages@v6

- name: Upload Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: docfx/_site

Expand All @@ -72,4 +72,4 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
38 changes: 28 additions & 10 deletions src/Fhir.CodeGen.Common/Utils/FileSystemUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,34 @@ public static string FindRelativeDir(
return dirName;
}

if (dirName.StartsWith('~'))
{
string profile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (string.IsNullOrEmpty(profile))
{
profile = Path.GetDirectoryName(AppContext.BaseDirectory) ?? ".";
}

string relative = dirName.Length >= 2 && (dirName[1] == '/' || dirName[1] == '\\')
? dirName.Substring(2)
: dirName.Substring(1);

string expanded = string.IsNullOrEmpty(relative)
? profile
: Path.GetFullPath(Path.Combine(profile, relative));

if (Directory.Exists(expanded))
{
return expanded;
}

if (throwIfNotFound)
{
throw new DirectoryNotFoundException($"Could not find directory {dirName}!");
}

return string.Empty;
}

string currentDir = startDir switch
{
Expand All @@ -52,16 +80,6 @@ public static string FindRelativeDir(
_ => startDir,
};

if (dirName.StartsWith('~'))
{
currentDir = Path.GetDirectoryName(Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) ?? Path.GetDirectoryName(AppContext.BaseDirectory) ?? ".",
dirName[2..]))
?? currentDir;

dirName = dirName[2..];
}

if (currentDir.StartsWith('~'))
{
currentDir = Path.GetDirectoryName(Path.Combine(
Expand Down
Loading
Loading