mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-16 05:18:24 +00:00
Going forward for new installations, config and data files will be stored at the platform default paths, as defined by [env-paths](https://www.npmjs.com/package/env-paths). For backwards compatibility, if the `~/.waveterm` or `WAVETERM_HOME` directory exists and contains valid data, it will be used. If this check fails, then `WAVETERM_DATA_HOME` and `WAVETERM_CONFIG_HOME` will be used. If these are not defined, then `XDG_DATA_HOME` and `XDG_CONFIG_HOME` will be used. Finally, if none of these are defined, the [env-paths](https://www.npmjs.com/package/env-paths) defaults will be used. As with the existing app, dev instances will write to `waveterm-dev` directories, while all others will write to `waveterm`.
15 lines
211 B
Go
15 lines
211 B
Go
package panic
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
var shouldPanic = len(os.Getenv("NO_PANIC")) == 0
|
|
|
|
// Wraps log.Panic, ignored if NO_PANIC is set
|
|
func Panic(message string) {
|
|
if shouldPanic {
|
|
log.Panic(message)
|
|
}
|
|
}
|