1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 10:03:22 +03:00
juvix/app
Paul Cadman e8a5d20d07
Add -n/--non-interactive option to juvix init (#2500)
When moving to Package.juvix, the package configuration file cannot be
empty. So it's convenient to have a quick way to create a Package.juvix
file (previously you could run `touch juvix.yaml`.

This PR adds the `-n / --non-interactive` option to `juvix init`. This
will create a default `Package.juvix`, using the name of the current
directory to populate the package name.

Similarly for the interactive version of juvix init, if the name of the
current directory is not a valid Juvix module then a fallback name is
used instead.

For example:
```
$ mkdir /tmp/new-package
$ cd /tmp/new-package
$ juvix init -n
$ cat Package.juvix
module Package;

import PackageDescription.V1 open;

package : Package :=
  defaultPackage
    {name := "new-package";
     version := mkVersion 0 0 0;
     dependencies := [defaultStdlib]};
```

* Part of https://github.com/anoma/juvix/issues/2487
2023-11-06 13:56:20 +00:00
..
Commands Add -n/--non-interactive option to juvix init (#2500) 2023-11-06 13:56:20 +00:00
TopCommand Add -n/--non-interactive option to juvix init (#2500) 2023-11-06 13:56:20 +00:00
App.hs Rename Roots type to Root (#2480) 2023-10-30 14:05:52 +01:00
AsmInterpreter.hs Refactor Core datastructures (#1975) 2023-04-04 18:58:05 +02:00
CommonOptions.hs Add FileExt type (#2467) 2023-10-25 12:02:12 +02:00
Evaluator.hs Use a Juvix source file to define a package (#2434) 2023-10-27 12:35:20 +01:00
GlobalOptions.hs Rename Roots type to Root (#2480) 2023-10-30 14:05:52 +01:00
Main.hs Rename Roots type to Root (#2480) 2023-10-30 14:05:52 +01:00
TopCommand.hs Add -n/--non-interactive option to juvix init (#2500) 2023-11-06 13:56:20 +00:00