-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: updates README, slight change to the API
- Loading branch information
1 parent
ea90faa
commit 3c3d80a
Showing
8 changed files
with
217 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require('path') | ||
const JSON_BUMP_FILES = require('../../defaults').bumpFiles | ||
const PLAIN_TEXT_BUMP_FILES = ['VERSION.txt', 'version.txt'] | ||
|
||
function getUpdaterByType (type) { | ||
try { | ||
return require(`./types/${type}`) | ||
} catch (e) { | ||
throw Error(`Unable to locate updated for provided type (${type}).`) | ||
} | ||
} | ||
|
||
module.exports.getUpdaterByType = getUpdaterByType | ||
|
||
module.exports.getUpdaterByFilename = function (filename) { | ||
if (JSON_BUMP_FILES.includes(filename)) { | ||
return getUpdaterByType('json') | ||
} | ||
if (PLAIN_TEXT_BUMP_FILES.includes(filename)) { | ||
return getUpdaterByType('plain-text') | ||
} | ||
throw Error( | ||
`Unsupported file (${filename}) provided for bumping.\n Please specifcy the updater \`type\` or use a custom \`updater\`.` | ||
) | ||
} | ||
|
||
module.exports.getCustomUpdater = function (updater) { | ||
return require(path.resolve(process.cwd(), updater)) | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
defmodule StandardVersion.MixProject do | ||
use Mix.Project | ||
|
||
def project do | ||
[ | ||
app: :standard_version | ||
version: "0.0.1", | ||
elixir: "~> 1.8", | ||
app: :standard_version, | ||
version: "0.1.0", | ||
elixir: "~> 1.9", | ||
start_permanent: Mix.env() == :prod, | ||
deps: deps() | ||
] | ||
end | ||
end | ||
|
||
# Run "mix help compile.app" to learn about applications. | ||
def application do | ||
[ | ||
extra_applications: [:logger] | ||
] | ||
end | ||
|
||
# Run "mix help deps" to learn about dependencies. | ||
defp deps do | ||
[ | ||
# {:dep_from_hexpm, "~> 0.3.0"}, | ||
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} | ||
] | ||
end | ||
end |