mirror of
https://github.com/Graylog2/graylog-project-cli.git
synced 2026-03-13 08:02:57 +08:00
* Add google/renameio/v2 dependency * Add new command to generate IntelliJ run configurations * Detect the OpenSearch version for the Data Node config * Use .template as template file suffix The regenerate command picks up all ".xml.tmpl" files in the repository and fails on the run configuration template. So we use a different suffix to avoid that issue. * Update dependencies * Warn users about hostname setup in /etc/hosts On Linux the *.localhost hostnames work automatically. On other operating systems the users have to add the names to /etc/hosts.
16 lines
264 B
Go
16 lines
264 B
Go
//go:build !windows
|
|
|
|
package utils
|
|
|
|
import (
|
|
"github.com/google/renameio/v2"
|
|
"os"
|
|
)
|
|
|
|
func AtomicallyWriteFile(filename string, data []byte, perm os.FileMode) error {
|
|
if err := renameio.WriteFile(filename, data, perm); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|