Change module path to relative, add check for empty tag on import

This commit is contained in:
Andrey Vasnetsov 2018-03-04 17:56:00 +03:00
parent 837c470176
commit 222ff0371e
No known key found for this signature in database
GPG key ID: 8AAD134C846571BE
10 changed files with 15 additions and 13 deletions

View file

@ -5,8 +5,8 @@ import (
"strings" "strings"
"time" "time"
"../model"
"github.com/RadhiFadlillah/go-readability" "github.com/RadhiFadlillah/go-readability"
"github.com/RadhiFadlillah/shiori/model"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View file

@ -7,7 +7,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/RadhiFadlillah/shiori/model" "../model"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View file

@ -7,8 +7,8 @@ import (
"strings" "strings"
"time" "time"
"../model"
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/RadhiFadlillah/shiori/model"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -73,7 +73,9 @@ func importBookmarks(pth string, generateTag bool) error {
// Get bookmark tags // Get bookmark tags
tags := []model.Tag{} tags := []model.Tag{}
for _, strTag := range strings.Split(strTags, ",") { for _, strTag := range strings.Split(strTags, ",") {
tags = append(tags, model.Tag{Name: strTag}) if strTag != "" {
tags = append(tags, model.Tag{Name: strTag})
}
} }
// Get bookmark excerpt // Get bookmark excerpt

View file

@ -6,7 +6,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/RadhiFadlillah/shiori/model" "../model"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/RadhiFadlillah/shiori/database" "../database"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View file

@ -13,8 +13,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/RadhiFadlillah/shiori/assets" "../assets"
"github.com/RadhiFadlillah/shiori/model" "../model"
"github.com/dgrijalva/jwt-go" "github.com/dgrijalva/jwt-go"
"github.com/dgrijalva/jwt-go/request" "github.com/dgrijalva/jwt-go/request"
"github.com/julienschmidt/httprouter" "github.com/julienschmidt/httprouter"

View file

@ -8,8 +8,8 @@ import (
"sync" "sync"
"time" "time"
"../model"
"github.com/RadhiFadlillah/go-readability" "github.com/RadhiFadlillah/go-readability"
"github.com/RadhiFadlillah/shiori/model"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View file

@ -3,7 +3,7 @@ package database
import ( import (
"database/sql" "database/sql"
"github.com/RadhiFadlillah/shiori/model" "../model"
) )
// Database is interface for manipulating data in database. // Database is interface for manipulating data in database.

View file

@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/RadhiFadlillah/shiori/model" "../model"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )

View file

@ -2,8 +2,8 @@
package main package main
import ( import (
"github.com/RadhiFadlillah/shiori/cmd" "./cmd"
db "github.com/RadhiFadlillah/shiori/database" db "./database"
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
) )