<commit_before>package main

import (
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"runtime"
)

// NodeVersion is the current node version
var NodeVersion = "?"

// RunScript runs some node code
func (p *Plugins) RunScript(script string) (cmd *exec.Cmd, done func()) {
	cacheTmp := filepath.Join(CacheHome, "tmp")
	os.MkdirAll(cacheTmp, 0755)
	f, err := ioutil.TempFile(cacheTmp, "heroku-script-")
	if err != nil {
		LogIfError(err)
	}
	if f != nil {
		defer f.Close()
		if _, err := f.WriteString(script); err != nil {
			LogIfError(err)
		}
		cmd = exec.Command(nodeBinPath(), f.Name())
	} else {
		cmd = exec.Command(nodeBinPath(), "-e", script)
	}
	cmd.Env = append([]string{"NODE_PATH=" + p.modulesPath()}, os.Environ()...)
	return cmd, func() {
		if f != nil {
			os.Remove(f.Name())
		}
	}
}

func nodeBinPath() string {
	b := os.Getenv("HEROKU_NODE_PATH")
	ext := ""
	if runtime.GOOS == WINDOWS {<commit_msg>ignore logging error when creating tmp script<commit_after>package main

import (
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"runtime"
)

// NodeVersion is the current node version
var NodeVersion = "?"

// RunScript runs some node code
func (p *Plugins) RunScript(script string) (cmd *exec.Cmd, done func()) {
	cacheTmp := filepath.Join(CacheHome, "tmp")
	os.MkdirAll(cacheTmp, 0755)
	f, _ := ioutil.TempFile(cacheTmp, "heroku-script-")
	if f != nil {
		defer f.Close()
		if _, err := f.WriteString(script); err != nil {
			LogIfError(err)
		}
		cmd = exec.Command(nodeBinPath(), f.Name())
	} else {
		cmd = exec.Command(nodeBinPath(), "-e", script)
	}
	cmd.Env = append([]string{"NODE_PATH=" + p.modulesPath()}, os.Environ()...)
	return cmd, func() {
		if f != nil {
			os.Remove(f.Name())
		}
	}
}

func nodeBinPath() string {
	b := os.Getenv("HEROKU_NODE_PATH")
	ext := ""
	if runtime.GOOS == WINDOWS {
{'fraction_non_alphanumeric': 0.17923497267759564, 'fraction_numerical': 0.004371584699453552, 'mean_word_length': 3.7931937172774868, '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': '1227349', 'n_tokens_mistral': 742, 'n_tokens_neox': 714, 'n_words': 165}