Skip to content
This repository has been archived by the owner on Sep 5, 2021. It is now read-only.

Commit

Permalink
Upgrade to Go 1.11
Browse files Browse the repository at this point in the history
Use go mod instead of dep
  • Loading branch information
crazy-max committed Sep 6, 2018
1 parent d5b5279 commit 984c4bb
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# App
/.dev
/bin
/vendor
/*.syso
/*.exe
/go.sum
/versioninfo.json
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.4.1 (2018/09/06)

* Upgrade to Go 1.11
* Use [go mod](https://golang.org/cmd/go/#hdr-Module_maintenance) instead of `dep`

## 2.4.0 (2018/02/10)

* Pass custom arguments directly to node through nodejs-portable (Issue #34)
Expand Down
51 changes: 0 additions & 51 deletions Gopkg.lock

This file was deleted.

18 changes: 0 additions & 18 deletions Gopkg.toml

This file was deleted.

166 changes: 17 additions & 149 deletions app/bindata/bindata.go
Original file line number Diff line number Diff line change
@@ -1,134 +1,50 @@
// Code generated by go-bindata.
// sources:
// nodejs-portable.conf
// DO NOT EDIT!

package bindata

import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)

func bindataRead(data []byte, name string) ([]byte, error) {
func bindata_read(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}

var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
gz.Close()

if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
if clErr != nil {
return nil, err
}

return buf.Bytes(), nil
}

type asset struct {
bytes []byte
info os.FileInfo
}

type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
}

func (fi bindataFileInfo) Name() string {
return fi.name
}
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
return false
}
func (fi bindataFileInfo) Sys() interface{} {
return nil
}

var _nodejsPortableConf = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\x8c\xc1\x8a\xc2\x30\x14\x45\xf7\xf9\x8a\xcb\x5b\xcd\xc0\x90\x0c\x22\x22\xd9\x2a\xba\x12\xba\x17\x29\x8f\xf6\x69\x83\x4d\x23\x49\xac\x82\xf8\xef\x92\xd6\xe5\x3d\x87\x73\x5f\x0a\xa0\x51\x62\x72\x61\x20\x0b\x5a\xe8\xa5\xfe\xa7\xbf\x42\x9d\xf7\xd2\x3a\xce\x72\x08\xad\x90\xc5\x99\xfb\x24\x93\x79\x84\x78\xad\x38\x77\x25\xd0\xa6\xac\xb9\x68\xee\x29\x07\x5f\x4c\x22\x8b\xa3\x02\x00\xda\x58\x53\xc5\x70\x89\xec\xb1\x73\xbd\x24\xfc\x3c\xd7\xab\x5f\xb3\x77\xd9\x34\xbe\x9d\x42\x80\xb6\xd6\xf0\x10\x72\x27\xb1\xbe\x95\xe7\x2f\xd6\xda\x70\x1d\xa5\xe7\xec\x46\x99\x8d\x02\x4e\xea\xad\x3e\x01\x00\x00\xff\xff\x22\x75\x84\xa3\xb9\x00\x00\x00")
var _nodejs_portable_conf = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\x8c\xc1\x8a\xc2\x30\x14\x45\xf7\xf9\x8a\xcb\x5b\xcd\xc0\x90\x30\x22\x22\xd9\x2a\xba\x12\xba\x17\x29\x8f\xf6\x69\x83\x4d\x23\x49\xac\x82\xf8\xef\x92\xd6\xe5\x3d\x87\x73\x5f\x0a\xa0\x51\x62\x72\x61\x20\x0b\x5a\xe8\xa5\xfe\xa7\xbf\x42\x9d\xf7\xd2\x3a\xce\x72\x08\xad\x90\xc5\x99\xfb\x24\x93\x79\x84\x78\xad\x38\x77\x25\xd0\xa6\xac\xb9\x68\xee\x29\x07\x5f\x4c\x22\x8b\xa3\x02\x00\xda\x58\x53\xc5\x70\x89\xec\xb1\x73\xbd\x24\xfc\x3c\xd7\xab\x5f\xb3\x77\xd9\x34\xbe\x9d\x42\x80\xb6\xd6\xf0\x10\x72\x27\xb1\xbe\x95\xe7\x2f\xd6\xda\x70\x1d\xa5\xe7\xec\x46\x99\x8d\x02\x4e\xea\xad\x3e\x01\x00\x00\xff\xff\x1e\xeb\x9c\xb2\xb9\x00\x00\x00")

func nodejsPortableConfBytes() ([]byte, error) {
return bindataRead(
_nodejsPortableConf,
func nodejs_portable_conf() ([]byte, error) {
return bindata_read(
_nodejs_portable_conf,
"nodejs-portable.conf",
)
}

func nodejsPortableConf() (*asset, error) {
bytes, err := nodejsPortableConfBytes()
if err != nil {
return nil, err
}

info := bindataFileInfo{name: "nodejs-portable.conf", size: 185, mode: os.FileMode(438), modTime: time.Unix(1518280055, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
return f()
}
return nil, fmt.Errorf("Asset %s not found", name)
}

// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}

return a
}

// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("AssetInfo %s not found", name)
}

// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
Expand All @@ -139,10 +55,9 @@ func AssetNames() []string {
}

// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"nodejs-portable.conf": nodejsPortableConf,
var _bindata = map[string]func() ([]byte, error){
"nodejs-portable.conf": nodejs_portable_conf,
}

// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
Expand Down Expand Up @@ -172,64 +87,17 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
for name := range node.Children {
rv = append(rv, name)
}
return rv, nil
}

type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
type _bintree_t struct {
Func func() ([]byte, error)
Children map[string]*_bintree_t
}
var _bintree = &bintree{nil, map[string]*bintree{
"nodejs-portable.conf": &bintree{nodejsPortableConf, map[string]*bintree{}},
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
"nodejs-portable.conf": &_bintree_t{nodejs_portable_conf, map[string]*_bintree_t{
}},
}}

// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}

// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
}

func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ version: '{build}'
platform:
- x86

clone_folder: C:\gopath\src\github.com\crazy-max\nodejs-portable

environment:
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
GOPATH: C:\gopath
GOROOT: C:\go\
GOVERSION: 1.9.2
GOVERSION: 1.11

install:
- ps: choco install ant
Expand All @@ -28,7 +26,7 @@ build_script:

after_build:
- ps: |
$env:APP_VERSION = Get-Content C:\gopath\src\github.com\crazy-max\nodejs-portable\bin\tmp\version.dat -Raw
$env:APP_VERSION = Get-Content "$env:APPVEYOR_BUILD_FOLDER\bin\tmp\version.dat" -Raw
Write-Host "App version: $env:APP_VERSION"
artifacts:
Expand Down
3 changes: 1 addition & 2 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ app.name = Node.js Portable
app.desc = Make Node.js portable on Windows
app.package = github.com/crazy-max/nodejs-portable
app.url = https://${app.package}
app.version = 2.4.0
app.version = 2.4.1
app.default.release = 0

# Libs
antcontrib.url = http://search.maven.org/remotecontent?filepath=ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar
dep.package = github.com/golang/dep/...
upx.url = https://github.com/upx/upx/releases/download/v3.94/upx394w.zip
Loading

0 comments on commit 984c4bb

Please sign in to comment.