mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-12-25 04:19:47 +00:00
Fix generating for packages inside modules
This commit is contained in:
parent
af5691b0d4
commit
25a2f45e59
15
generate.go
15
generate.go
@ -131,7 +131,9 @@ func generate(l *libvirt.Libvirt, pkg, bin, vmname string) (err error) {
|
|||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if f.Name() == pkg {
|
parts := strings.Split(pkg, ".")
|
||||||
|
log.Println("pkg", parts[len(parts)-1])
|
||||||
|
if f.Name() == parts[len(parts)-1] {
|
||||||
log.Println("Use", f.Name())
|
log.Println("Use", f.Name())
|
||||||
bin = f.Name()
|
bin = f.Name()
|
||||||
found = true
|
found = true
|
||||||
@ -161,7 +163,16 @@ func generate(l *libvirt.Libvirt, pkg, bin, vmname string) (err error) {
|
|||||||
bin = files[0].Name()
|
bin = files[0].Name()
|
||||||
}
|
}
|
||||||
|
|
||||||
realName := strings.Split(name, ".")[1]
|
var realName string
|
||||||
|
for i, s := range strings.Split(name, ".") {
|
||||||
|
if i == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if i != 1 {
|
||||||
|
realName += "."
|
||||||
|
}
|
||||||
|
realName += s
|
||||||
|
}
|
||||||
|
|
||||||
var appFilename string
|
var appFilename string
|
||||||
if vmname != "" {
|
if vmname != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user