@@ -547,29 +547,27 @@ function status(ctx::Context, mode=PKGMODE_PROJECT)
547
547
return
548
548
end
549
549
550
- function activate (path:: Union{String,Nothing} = nothing )
551
- if path != = nothing
552
- devpath = nothing
553
- env = Base. active_project () === nothing ? nothing : EnvCache ()
554
- if env != = nothing && haskey (env. project[" deps" ], path)
555
- uuid = UUID (env. project[" deps" ][path])
556
- info = manifest_info (env, uuid)
557
- devpath = haskey (info, " path" ) ? joinpath (dirname (env. project_file), info[" path" ]) : nothing
558
- end
559
- # `pkg> activate path`/`Pkg.activate(path)` does the following
560
- # 1. if path exists, activate that
561
- # 2. if path exists in deps, and the dep is deved, activate that path (`devpath` above)
562
- # 3. activate the non-existing directory (e.g. as in `pkg> activate .` for initing a new env)
563
- if Types. isdir_windows_workaround (path)
564
- path = abspath (path)
565
- elseif devpath != = nothing
566
- path = abspath (devpath)
567
- else
568
- path = abspath (path)
569
- end
550
+ activate () = (Base. ACTIVE_PROJECT[] = Base. load_path_expand (nothing ))
551
+ function activate (path:: String )
552
+ devpath = nothing
553
+ env = Base. active_project () === nothing ? nothing : EnvCache ()
554
+ if env != = nothing && haskey (env. project[" deps" ], path)
555
+ uuid = UUID (env. project[" deps" ][path])
556
+ info = manifest_info (env, uuid)
557
+ devpath = haskey (info, " path" ) ? joinpath (dirname (env. project_file), info[" path" ]) : nothing
558
+ end
559
+ # `pkg> activate path`/`Pkg.activate(path)` does the following
560
+ # 1. if path exists, activate that
561
+ # 2. if path exists in deps, and the dep is deved, activate that path (`devpath` above)
562
+ # 3. activate the non-existing directory (e.g. as in `pkg> activate .` for initing a new env)
563
+ if Types. isdir_windows_workaround (path)
564
+ path = abspath (path)
565
+ elseif devpath != = nothing
566
+ path = abspath (devpath)
567
+ else
568
+ path = abspath (path)
570
569
end
571
570
Base. ACTIVE_PROJECT[] = Base. load_path_expand (path)
572
- return
573
571
end
574
572
575
573
"""
0 commit comments