Skip to content

Commit

Permalink
Update Fix to make it easier to use
Browse files Browse the repository at this point in the history
  • Loading branch information
bpbecker committed Apr 12, 2020
1 parent 0906046 commit 3113aea
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions HttpCommand.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@

rVersion
:Access public shared
r'HttpCommand' '2.3.04' '2020-04-10'
r'HttpCommand' '2.3.05' '2020-04-10'

make
Expand Down Expand Up @@ -326,19 +326,26 @@
r.⎕DF 1'][rc: ',(r.rc),' | msg: "',r.msg,'"',(r.rc0)/' | HTTP Status: ',(r.HttpStatus),' "',r.HttpMessage,'" | ⍴Data: ',r.Data

rFix args;z;url;target
r{ro}Fix args;z;url;target
retrieve and fix APL code loads the latest version from GitHub
:Access public shared
(url target)2(,args),##
zGet url
:If 0=⎕NC'ro' ro0 :EndIf
rzro Get{ convert url if necessary
~/'github': if not github just
/'raw.githubusercontent.com': already refers to
t'/'()
i<\/¨'github'¨t
'https://raw.githubusercontent.com','/',¨(2it),('master'),(2+i)t
}url
ro0
:If z.rc0
rz.(rc msg)
:ElseIf z.HttpStatus200
r¯1(z)
:Else
:Trap 0
target.⎕FIX{~⎕UCS 13 10 65279}z.Data
r0 ''
r0(target{0::.⎕FX .⎕FIX }{~⎕UCS 13 10 65279}z.Data)
:Else
r¯1('Could not ⎕FIX file: ',2': ',¨⎕DMX.(EM Message))
:EndTrap
Expand Down

0 comments on commit 3113aea

Please sign in to comment.