From 564ebae3b82cdd8005913f51f5484d137dc0f6f4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 3 Jul 2026 01:49:40 +0200 Subject: [PATCH] Avoid using internal AutoDoc function --- tst/template.tst | 2 +- tst/utils.g | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tst/template.tst b/tst/template.tst index 92ba089..fb10dd0 100644 --- a/tst/template.tst +++ b/tst/template.tst @@ -21,7 +21,7 @@ gap> tmpdir := Filename( DirectoryTemporary(), "packagemaker-template-tst" );; gap> if IsDirectoryPath( tmpdir ) then RemoveDirectoryRecursively( tmpdir ); fi; gap> AUTODOC_CreateDirIfMissing( tmpdir ); true -gap> olddir := AUTODOC_CurrentDirectory();; +gap> olddir := PKGMKR_CurrentDirectory();; gap> ChangeDirectoryCurrent( tmpdir );; gap> AUTODOC_CreateDirIfMissing( pkginfo.PackageName ); true diff --git a/tst/utils.g b/tst/utils.g index d8b6978..0715b21 100644 --- a/tst/utils.g +++ b/tst/utils.g @@ -35,6 +35,19 @@ BindGlobal( "PKGMKR_ExpectedDir", function( name ) Concatenation( "tst/", name, ".expected" ) ); end ); +BindGlobal( "PKGMKR_CurrentDirectory", +function(args...) + local pwd, result, out; + pwd := Filename( DirectoriesSystemPrograms(), "pwd" ); + if pwd = fail then + Error("failed to locate 'pwd' tool"); + fi; + result := ""; + out := OutputTextString( result, true ); + Process( DirectoryCurrent(), pwd, InputTextNone(), out, []) ; + return Chomp( result ); +end ); + BindGlobal( "PKGMKR_GenerateFixture", function( name, answers ) local tempdir, olddir, actualdir; @@ -45,7 +58,7 @@ BindGlobal( "PKGMKR_GenerateFixture", function( name, answers ) fi; AUTODOC_CreateDirIfMissing( tempdir ); - olddir := AUTODOC_CurrentDirectory(); + olddir := PKGMKR_CurrentDirectory(); ChangeDirectoryCurrent( tempdir ); PackageWizardGenerate( answers : skipGitRepositorySetup := true ); ChangeDirectoryCurrent( olddir );