| 99 | } |
| 100 | |
| 101 | func writeLock(conf, confcopy *cfg.Config, base string) { |
| 102 | hash, err := conf.Hash() |
| 103 | if err != nil { |
| 104 | msg.Die("Failed to generate config hash. Unable to generate lock file.") |
| 105 | } |
| 106 | lock, err := cfg.NewLockfile(confcopy.Imports, confcopy.DevImports, hash) |
| 107 | if err != nil { |
| 108 | msg.Die("Failed to generate lock file: %s", err) |
| 109 | } |
| 110 | if err := lock.WriteFile(filepath.Join(base, gpath.LockFile)); err != nil { |
| 111 | msg.Die("Failed to write glide lock file: %s", err) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // addPkgsToConfig adds the given packages to the config file. |
| 116 | // |