<commit_before>package main

import (
	"archive/zip"
	"flag"
	"github.com/lonnc/golang-nw/build"
	"os"
	"path/filepath"
)

var (
	app  = "myapp.exe"
	out  = "myapp.nw"
	name = "My Application"
)

func main() {
	flag.StringVar(&app, "app", app, "Application to be wrapped by node-webkit.")
	flag.StringVar(&name, "name", name, "Application name.")
	flag.StringVar(&out, "out", out, "Destination file for generated node-webkit .nw file.")
	flag.Parse()

	if err := nwBuild(); err != nil {
		panic(err)
	}
}

func nwBuild() error {
	w, err := os.Create(out)
	if err != nil {
		return err
	}
	defer w.Close()

	zw := zip.NewWriter(w)
	defer zw.Close()

	r, err := os.Open(app)
	if err != nil {
		return err
	}
	defer r.Close()

	bin := filepath.Base(app)
	p := build.Package{Name: name, Bin: bin, Window: build.Window{Title: name}}

	if err := p.CreateNW(zw, build.DefaultTemplates, r); err != nil {
		return err
	}

	return nil
}
<commit_msg>Also add includes to cmd/golang-nw/build<commit_after>package main

import (
	"archive/zip"
	"flag"
	"github.com/lonnc/golang-nw/build"
	"os"
	"path/filepath"
)

var (
	app         = "myapp.exe"
	out         = "myapp.nw"
	name        = "My Application"
	includesDir = ""
)

func main() {
	flag.StringVar(&app, "app", app, "Application to be wrapped by node-webkit.")
	flag.StringVar(&name, "name", name, "Application name.")
	flag.StringVar(&out, "out", out, "Destination file for generated node-webkit .nw file.")
	flag.StringVar(&includesDir, "includesDir", includesDir, "Directory containing additional files to bundle with the .nw file")
	flag.Parse()

	if err := nwBuild(); err != nil {
		panic(err)
	}
}

func nwBuild() error {
	w, err := os.Create(out)
	if err != nil {
		return err
	}
	defer w.Close()

	zw := zip.NewWriter(w)
	defer zw.Close()

	r, err := os.Open(app)
	if err != nil {
		return err
	}
	defer r.Close()

	bin := filepath.Base(app)
	p := build.Package{Name: name, Bin: bin, Window: build.Window{Title: name}}

	if err := p.CreateNW(zw, build.DefaultTemplates, r, includesDir); err != nil {
		return err
	}

	return nil
}

{'fraction_non_alphanumeric': 0.1645873320537428, 'fraction_numerical': 0.0, 'mean_word_length': 3.512987012987013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '214740', 'n_tokens_mistral': 824, 'n_tokens_neox': 782, 'n_words': 213}