Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the REPL command ] generate #1923

Merged
merged 4 commits into from
Jul 18, 2020
Merged
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
2 changes: 1 addition & 1 deletion src/REPLMode/command_declarations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ patch version; if the `--fixed` upgrade level is given, then the following
packages will not be upgraded at all.
""",
],[ :name => "generate",
:api => API.generate,
:api => API.generate_deprecated,
:arg_count => 1 => 1,
:arg_parser => ((x,y) -> map(expanduser, unwrap(x))),
:description => "generate files for a new project",
Expand Down
5 changes: 5 additions & 0 deletions src/generate.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

function generate_deprecated(varargs...; kwargs...)
Base.depwarn("Pkg.generate is deprecated. Please use PkgTemplates.jl instead.", Symbol("Pkg.generate"))
return generate(varargs...; kwargs...)
end

generate(path::String; kwargs...) = generate(Context(), path; kwargs...)
function generate(ctx::Context, path::String; kwargs...)
Context!(ctx; kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ end
isolate() do
Pkg.REPLMode.TEST_MODE[] = true
api, arg, opts = first(Pkg.pkg"generate Foo")
@test api == Pkg.generate
@test api == Pkg.API.generate_deprecated
@test arg == "Foo"
@test isempty(opts)
mktempdir() do dir
Expand Down