build: attach: ensure we don't recursivelly call ourself.
This commit is contained in:
parent
5484f84764
commit
64d71ffb6e
1 changed files with 8 additions and 1 deletions
|
|
@ -31,6 +31,9 @@ func init() {
|
||||||
func (b ReAttach) Apply(opt *Option, profile string) (string, error) {
|
func (b ReAttach) Apply(opt *Option, profile string) (string, error) {
|
||||||
var insert string
|
var insert string
|
||||||
var origin = "profile " + opt.Name
|
var origin = "profile " + opt.Name
|
||||||
|
if opt.File.HasSuffix("attached/base") {
|
||||||
|
return profile, nil // Do not re-attach twice
|
||||||
|
}
|
||||||
|
|
||||||
if strings.Contains(profile, "attach_disconnected") {
|
if strings.Contains(profile, "attach_disconnected") {
|
||||||
insert = "@{att} = /att/" + opt.Name + "/\n"
|
insert = "@{att} = /att/" + opt.Name + "/\n"
|
||||||
|
|
@ -42,13 +45,17 @@ func (b ReAttach) Apply(opt *Option, profile string) (string, error) {
|
||||||
"include <abstractions/base>",
|
"include <abstractions/base>",
|
||||||
"include <abstractions/attached/base>",
|
"include <abstractions/attached/base>",
|
||||||
)
|
)
|
||||||
|
profile = strings.ReplaceAll(profile,
|
||||||
|
"include <abstractions/base-strict>",
|
||||||
|
"include <abstractions/attached/base>",
|
||||||
|
)
|
||||||
profile = strings.ReplaceAll(profile,
|
profile = strings.ReplaceAll(profile,
|
||||||
"include <abstractions/consoles>",
|
"include <abstractions/consoles>",
|
||||||
"include <abstractions/attached/consoles>",
|
"include <abstractions/attached/consoles>",
|
||||||
)
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
insert = "@{att} = /\n"
|
insert = "@{att} = \"\"\n"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue