Skip to content

Commit b3af1f1

Browse files
committed
Making initialize_setup work without internet
Adds Pkg if not possible to add DrWatson
1 parent 6a7d16b commit b3af1f1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DrWatson"
22
uuid = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
33
repo = "https://github.com/JuliaDynamics/DrWatson.jl.git"
4-
version = "0.5.1"
4+
version = "0.5.2"
55

66
[deps]
77
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"

src/project_setup.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,19 @@ function initialize_project(path, name = basename(path);
164164
if git; repo = LibGit2.init(path); end
165165
git && LibGit2.commit(repo, "Initial commit")
166166
Pkg.activate(path)
167-
Pkg.add("DrWatson")
168-
167+
try
168+
Pkg.add("DrWatson")
169+
catch
170+
@warn "Could not add DrWatson to project. Adding Pkg instead..."
171+
Pkg.add("Pkg")
172+
end
169173
# Default folders
170174
for p in DEFAULT_PATHS
171175
mkpath(joinpath(path, p))
172176
end
173177

174178
git && LibGit2.add!(repo, "Project.toml")
179+
git && LibGit2.add!(repo, "Manifest.toml")
175180
git && LibGit2.add!(repo, DEFAULT_PATHS...)
176181
git && LibGit2.commit(repo, "Folder setup by DrWatson")
177182

0 commit comments

Comments
 (0)