mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-22 20:23:01 +00:00
Handle case when there's no actions in .desktop file
This commit is contained in:
parent
1f4214199e
commit
1fbbdee76a
@ -32,7 +32,11 @@ func (r *ddf) OnAdd(ctx context.Context) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if bytes.Contains(b, []byte("Actions=")) {
|
||||
b = bytes.ReplaceAll(b, []byte("Actions="), []byte("Actions=appvm;"))
|
||||
} else {
|
||||
b = bytes.ReplaceAll(b, []byte("Exec="), []byte("Actions=appvm;\nExec="))
|
||||
}
|
||||
|
||||
raw := string(regexp.MustCompile("Exec=[a-zA-Z0-9]*").Find(b))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user