Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 1.10/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e

pushd /tmp/src

# try infer the package that we are building from the module file if we don't know it already
if [[ -z "$IMPORT_URL" && -f /tmp/src/go.mod ]]; then
IMPORT_URL=`head -1 go.mod|cut -d ' ' -f2`
fi

if [[ `go list -f {{.Incomplete}}` == "true" || ! -z "$IMPORT_URL" ]]; then

INSTALL_URL=${INSTALL_URL:-$IMPORT_URL}
Expand Down
5 changes: 5 additions & 0 deletions 1.11/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e

pushd /tmp/src

# try infer the package that we are building from the module file if we don't know it already
if [[ -z "$IMPORT_URL" && -f /tmp/src/go.mod ]]; then
IMPORT_URL=`head -1 go.mod|cut -d ' ' -f2`
fi

if [[ `go list -f {{.Incomplete}}` == "true" || ! -z "$IMPORT_URL" ]]; then

INSTALL_URL=${INSTALL_URL:-$IMPORT_URL}
Expand Down
5 changes: 5 additions & 0 deletions 1.8/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e

pushd /tmp/src

# try infer the package that we are building from the module file if we don't know it already
if [[ -z "$IMPORT_URL" && -f /tmp/src/go.mod ]]; then
IMPORT_URL=`head -1 go.mod|cut -d ' ' -f2`
fi

if [[ `go list -f {{.Incomplete}}` == "true" || ! -z "$IMPORT_URL" ]]; then

INSTALL_URL=${INSTALL_URL:-$IMPORT_URL}
Expand Down
5 changes: 5 additions & 0 deletions 1.9/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e

pushd /tmp/src

# try infer the package that we are building from the module file if we don't know it already
if [[ -z "$IMPORT_URL" && -f /tmp/src/go.mod ]]; then
IMPORT_URL=`head -1 go.mod|cut -d ' ' -f2`
fi

if [[ `go list -f {{.Incomplete}}` == "true" || ! -z "$IMPORT_URL" ]]; then

INSTALL_URL=${INSTALL_URL:-$IMPORT_URL}
Expand Down
8 changes: 8 additions & 0 deletions test/module-with-vendor-app/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM golang:1.8 AS build
COPY . /go/src/github.com/cpuguy83/go-md2man
WORKDIR /go/src/github.com/cpuguy83/go-md2man
RUN CGO_ENABLED=0 go build

FROM scratch
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/go-md2man /go-md2man
ENTRYPOINT ["/go-md2man"]
15 changes: 15 additions & 0 deletions test/module-with-vendor-app/app/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions test/module-with-vendor-app/app/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/russross/blackfriday"
version = "1.4"
21 changes: 21 additions & 0 deletions test/module-with-vendor-app/app/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Brian Goff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions test/module-with-vendor-app/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
go-md2man
=========

** Work in Progress **
This still needs a lot of help to be complete, or even usable!

Uses blackfriday to process markdown into man pages.

### Usage

./md2man -in /path/to/markdownfile.md -out /manfile/output/path

### How to contribute

We use [govend](https://github.com/govend/govend) for vendoring Go packages.

How to update dependencies: `govend -v -u --prune`

23 changes: 23 additions & 0 deletions test/module-with-vendor-app/app/go-md2man.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
go-md2man 1 "January 2015" go-md2man "User Manual"
==================================================

# NAME
go-md2man - Convert mardown files into manpages

# SYNOPSIS
go-md2man -in=[/path/to/md/file] -out=[/path/to/output]

# Description
go-md2man converts standard markdown formatted documents into manpages. It is
written purely in Go so as to reduce dependencies on 3rd party libs.

By default, the input is stdin and the output is stdout.

# Example
Convert the markdown file "go-md2man.1.md" into a manpage.

go-md2man -in=README.md -out=go-md2man.1.out

# HISTORY
January 2015, Originally compiled by Brian Goff( [email protected] )

5 changes: 5 additions & 0 deletions test/module-with-vendor-app/app/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/cpuguy83/go-md2man

go 1.12

require github.com/russross/blackfriday v0.0.0-20170728175326-4048872b16cc
51 changes: 51 additions & 0 deletions test/module-with-vendor-app/app/md2man.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package main

import (
"flag"
"fmt"
"io/ioutil"
"os"

"github.com/cpuguy83/go-md2man/md2man"
)

var inFilePath = flag.String("in", "", "Path to file to be processed (default: stdin)")
var outFilePath = flag.String("out", "", "Path to output processed file (default: stdout)")

func main() {
var err error
flag.Parse()

inFile := os.Stdin
if *inFilePath != "" {
inFile, err = os.Open(*inFilePath)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}
defer inFile.Close()

doc, err := ioutil.ReadAll(inFile)
if err != nil {
fmt.Println(err)
os.Exit(1)
}

out := md2man.Render(doc)

outFile := os.Stdout
if *outFilePath != "" {
outFile, err = os.Create(*outFilePath)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer outFile.Close()
}
_, err = outFile.Write(out)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}
19 changes: 19 additions & 0 deletions test/module-with-vendor-app/app/md2man/md2man.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package md2man

import (
"github.com/russross/blackfriday"
)

func Render(doc []byte) []byte {
renderer := RoffRenderer(0)
extensions := 0
extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS
extensions |= blackfriday.EXTENSION_TABLES
extensions |= blackfriday.EXTENSION_FENCED_CODE
extensions |= blackfriday.EXTENSION_AUTOLINK
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
extensions |= blackfriday.EXTENSION_FOOTNOTES
extensions |= blackfriday.EXTENSION_TITLEBLOCK

return blackfriday.Markdown(doc, renderer, extensions)
}
Loading