The latest spago 0.16.0 calls alternative backend command as
% psgo --run Main.main
when running spago run, and
% psgo --run Test.Main.main
when running spago test.
Then this PR is checking the command-line parameters trickily as follows.
if --run option is specified, then check the first string parameter following --run.
if the first string parameter is Main.main or Test.Main.main,
set moduleName as
Main (for Main.main) or Test.Main (for Test.Main.main),
and set files as the rest parameters.
% go project.localhost/purescript-native/output/Main
(for spago run)
or
% go project.localhost/purescript-native/output/Test.Main
(for spago test)
On the other hand,
in the Printer.hs, Test_Main module (more precisely Test.Main in implHeaderSource and
Test.Main in implFooterSource) is improved likeMain` module.
This PR is to resolve #45 .
Namely, this PR resolves
and
respectively.
The latest spago
0.16.0
calls alternative backend command aswhen running
spago run
, andwhen running
spago test
.Then this PR is checking the command-line parameters trickily as follows.
--run
option is specified, then check the first string parameter following--run
.Main.main
orTest.Main.main
, setmoduleName
asMain
(forMain.main
) orTest.Main
(forTest.Main.main
), and setfiles
as the rest parameters.Using this defined
moduleName
, callgo
command asThe corresponding command is
(for
spago run
) or(for
spago test
)On the other hand, in the
Printer.hs
,Test_Main
module (more preciselyTest.Main
in implHeaderSource andTest.Main
in implFooterSource) is improved like
Main` module.main
.main()
function.