Try 07
This commit is contained in:
parent
e7432d7fed
commit
6b22dd99c8
|
@ -28,14 +28,12 @@ func (hr *APKRepository) urlIsPresent() (bool, error) {
|
|||
|
||||
line := 1
|
||||
for scanner.Scan() {
|
||||
fmt.Printf("DBG:%s:%s:\n", scanner.Text(), hr.URL)
|
||||
if strings.Contains(scanner.Text(), hr.URL) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
line++
|
||||
}
|
||||
fmt.Printf("END\n")
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
return false, err
|
||||
|
@ -52,11 +50,9 @@ func (hr *APKRepository) Add() error {
|
|||
}
|
||||
|
||||
if URLIsPresent {
|
||||
fmt.Printf("DEBUG %v\n", URLIsPresent)
|
||||
return nil
|
||||
} else {
|
||||
data := fmt.Sprintf("%s\n", hr.URL)
|
||||
fmt.Printf("DEBUG %v", data)
|
||||
file, err := os.OpenFile(APKConfigFile, os.O_APPEND|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue