Skip to content

Commit

Permalink
update compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mkideal committed Oct 13, 2024
1 parent 9d9faa7 commit 2056550
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/compile/next.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"maps"
"os"
"path/filepath"
"runtime"
"slices"
"strconv"
"strings"
Expand Down Expand Up @@ -272,7 +273,7 @@ func Compile(platform Platform, builtin FileSystem, args []string) {
flagSet.SetOutput(term.ColorizeWriter(stderr, term.Red))
usageFunc := func() {
flagSet.SetOutput(stderr)
name := term.Bold.Colorize(args[0])
name := term.Bold.Colorize(op.If(runtime.GOOS == "windows", "next", args[0]))
term.Fprint(flagSet.Output(), "Next is an IDL for generating customized code across multiple languages.\n\n")
term.Fprint(flagSet.Output(), "Usage:\n")
term.Fprintf(flagSet.Output(), " %s [Options] [source_dirs_or_files...] (default: current directory)\n", name)
Expand Down Expand Up @@ -300,6 +301,13 @@ func Compile(platform Platform, builtin FileSystem, args []string) {
(term.Bold + term.BrightBlue).Colorize(repository),
)
}

if len(args) == 1 {
// show usage message if no arguments are provided
usageFunc()
unwrap(stderr, 0)
}

if err := flagSet.Parse(args[1:]); err != nil {
if err == flag.ErrHelp {
usageFunc()
Expand Down
4 changes: 4 additions & 0 deletions website/docs/downloads.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const repo = () => useDocusaurusContext().siteConfig.customFields.repo;

## Latest Version

:::note
If you want to install Next, follow the [installation instructions](/docs#installation).
:::

<FeaturedDownloads />

The latest all releases of Next can be found on the <a target="_blank" href={`${repo()}/releases/latest`}>GitHub release page</a>.
Expand Down
10 changes: 8 additions & 2 deletions website/docs/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ flowchart TD
]}>

<TabItem value="unix">
To install Next on Unix-like systems, you can use the following command:
To install Next on Unix-like systems (Linux, macOS, and Git-Bash for windows, etc.), you can use the following command:

```sh
curl -fsSL https://getnext.sh | sh
Expand All @@ -97,14 +97,20 @@ This script will download and install the latest version of Next on your system.
If the downloading is very slow, you can use a https proxy like this:

```sh
curl -fsSL https://getnext.sh | https_proxy=http://127.0.0.1:1087 sh
curl -fsSL https://getnext.sh | https_proxy=http://127.0.0.1:1080 sh
```

:::

</TabItem>

<TabItem value="windows">
:::note
You can install Next using Git-Bash following **Unix-like**:
```sh
curl -fsSL https://getnext.sh | sh
```
:::
For Windows users, follow these steps:

1. Download the `.msi` installer from [Downloads](/docs/downloads) for windows.
Expand Down
14 changes: 13 additions & 1 deletion website/src/components/FeaturedDownloads/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import { FaWindows, FaApple, FaLinux } from "react-icons/fa";
import { SiGnu } from "react-icons/si";
import styles from "./styles.module.css";

interface DownloadItem {
title: string;
description: string;
fileName: string;
icon: React.ComponentType<React.ComponentProps<"svg">>;
chipIcon?: React.ComponentType<React.ComponentProps<"svg">>;
}

const FeaturedDownloads: React.FC = () => {
Expand Down Expand Up @@ -43,6 +43,18 @@ const FeaturedDownloads: React.FC = () => {
fileName: `next${version}.linux-amd64.tar.gz`,
icon: FaLinux,
},
{
title: "MinGW-64 (Windows)",
description: "Windows 10 or later, Intel 64-bit processor",
fileName: `next${version}.mingw-amd64.tar.gz`,
icon: SiGnu,
},
{
title: "MinGW-32 (Windows)",
description: "Windows 10 or later, Intel 32-bit processor",
fileName: `next${version}.mingw-386.tar.gz`,
icon: SiGnu,
},
];

return (
Expand Down

0 comments on commit 2056550

Please sign in to comment.