Skip to content

Commit

Permalink
Merge pull request #699 from Dyalog/554-link-to-irrelevant-files
Browse files Browse the repository at this point in the history
Fix #554 Allow link of non-empty ns to folder which only contains "irrelevant" files
  • Loading branch information
mkromberg authored Feb 3, 2025
2 parents b86fc6b + 019c1e3 commit b980e5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions StartupSession/Link/Create.aplf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
msg{opts}Create args;ns;dir;arrow;container;emptydir;emptyns;fail;hasdir;hasns;links;nc;nsref;nsrefs;overwrite;rawns;rsi;warnmsg;xsi;⎕IO;⎕ML;dircreated;DEBUG;setconfig;setopts;z;json;config;rc;isfile;actname;actclass;leaf;file;fulltarget;singlefile;singlenc;nohold;m;nsgiven;up;parts;ext;suppliedopts
msg{opts}Create args;ns;dir;arrow;container;emptydir;emptyns;fail;hasdir;hasns;links;nc;nsref;nsrefs;overwrite;rawns;rsi;warnmsg;xsi;⎕IO;⎕ML;dircreated;DEBUG;setconfig;setopts;z;json;config;rc;isfile;actname;actclass;leaf;file;fulltarget;singlefile;singlenc;nohold;m;nsgiven;up;parts;ext;name;type;suppliedopts
⎕IO ⎕ML1 1
preProcessOpts Make sure opts is a namespace
(container ns dir nsgiven)preProcessNsDir args
Expand Down Expand Up @@ -52,7 +52,8 @@ NOHOLD:
nsrefcontainer
emptydir0
:Else
emptydir0(⎕NINFO1)dir,'/*'
(name type)0 1 (⎕NINFO('Wildcard' 1)('Recurse' 2))dir,'/*'
emptydir0=(opts.codeExtensions,'apla')1¨3¨⎕NPARTS¨(type=2)/name
:EndIf
:Else
emptydir1 isfile0
Expand Down
5 changes: 5 additions & 0 deletions Test/test_create.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@
zopts LinkCreate name folder
'link issue #230'assert'~∨/''ERRORS ENCOUNTERED''⍷z'
{}⎕SE.Link.Break name
('Hello') ⎕NPUT folder,'/hello.txt'
zopts LinkCreate name folder
'link issue #554'assert'~∨/''ERRORS ENCOUNTERED''⍷z'
{}⎕SE.Link.Break name
⎕NDELETE folder,'/hello.txt'
subname'foo←{⍺+⍵}'
assertError'opts LinkCreate name folder' 'Cannot link a non-empty namespace to a non-empty directory'
⎕EX subname,'.foo'
Expand Down

0 comments on commit b980e5a

Please sign in to comment.