Skip to content

Commit

Permalink
Merge branch 'release/v1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryG13 committed Jun 15, 2020
2 parents 2bc125a + d4dbd02 commit f110286
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
30 changes: 7 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,30 @@ BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
# Symlink into GOPATH
GITHUB_USERNAME=amauryg13
PROJECT_DIR=${GOPATH}/src/github.com/${GITHUB_USERNAME}/${BINARY}
CURRENT_DIR=$(shell pwd)
PROJECT_DIR_LINK=$(shell readlink ${BUILD_DIR})

BUILD_DIR = ${PROJECT_DIR}/build
MAIN = ${PROJECT_DIR}/cmd/${BINARY}/main.go

# Setup the -ldflags option for go build here, interpolate the variable values
LDFLAGS = -ldflags "-X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT} -X main.BRANCH=${BRANCH}"
LDFLAGS = -ldflags "-X main.Version=${VERSION} -X main.Commit=${COMMIT} -X main.Branch=${BRANCH}"

# Build the project
all: link clean test linux darwin windows

link:
PROJECT_DIR=${PROJECT_DIR}; \
PROJECT_DIR_LINK=${PROJECT_DIR_LINK}; \
CURRENT_DIR=${CURRENT_DIR}; \

if [ "$${PROJECT_DIR_LINK}" != "$${CURRENT_DIR}" ]; then \
echo "Fixing symlinks for PROJECT dir"; \
rm -f $${PROJECT_DIR}; \
ln -s $${CURRENT_DIR} $${PROJECT_DIR}; \
fi

mkdir -p ${BUILD_DIR}

linux:
cd ${BUILD_DIR}; \
GOOS=linux GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-linux-${GOARCH} ${MAIN} ; \
cd - >/dev/null
cd ${BUILD_DIR} \
GOOS=linux GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-linux-${GOARCH} ${MAIN}

darwin:
cd ${BUILD_DIR}; \
GOOS=darwin GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-darwin-${GOARCH} ${MAIN} ; \
cd - >/dev/null
cd ${BUILD_DIR} \
GOOS=darwin GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-darwin-${GOARCH} ${MAIN}

windows:
cd ${BUILD_DIR}; \
GOOS=windows GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-windows-${GOARCH}.exe ${MAIN} ; \
cd - >/dev/null

cd ${BUILD_DIR} \
GOOS=windows GOARCH=${GOARCH} ${GOBUILD} ${LDFLAGS} -o ${BUILD_DIR}/${BINARY}-windows-${GOARCH}.exe ${MAIN}
test:
${GOTEST} ./...

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ En plaçant le script dans le même dossier que le fichier à convertir (fichier

L'exécutable peut prendre en ligne de commande 4 arguments : 1 obligatoire et 3 optionnels

- ```filepath```: le chemin vers le fichier à convertir
- ```-eol ```: le caractère de saut de ligne (par défaut "\n")
- ```-sep ```: le caractère de séparation des données (par défaut ";")
- ```-uwc```: une liste (séparéé par des virgules) de caractère à enlever (en plus des caratèses de base)
- ``` filepath ```: le chemin vers le fichier à convertir
- ``` -eol ```: le caractère de saut de ligne (par défaut "\n")
- ``` -sep ```: le caractère de séparation des données (par défaut ";")
- ``` -uwc```: une liste (séparéé par des virgules) de caractère à enlever (en plus des caratèses de base)

+ 1 paramètres :

- ``` -h ```: pour afficher l'aide

### Interaction

Expand Down
5 changes: 4 additions & 1 deletion cmd/airtable-convertor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func init() {
flag.StringVar(&eol, "eol", "\n", "Default end of line character")
flag.Var(&uwcFlag, "uwc", "Additional (comma separated) unwanted chars to removed")
flag.BoolVar(&help, "h", false, "Display help")
flag.BoolVar(&verbose, "v", false, "Display verbose debug info")
}

func main() {
Expand All @@ -55,6 +54,10 @@ func main() {

interaction.Notify("context", [5]string{"sep", "eol", "uwc", "help", "verbose"}, sep, eol, uwcFlag, help, verbose)

if help {
fnUsage()
}

if flag.NArg() == 1 {
filepath = flag.Args()[0]
} else {
Expand Down

0 comments on commit f110286

Please sign in to comment.