Skip to content

A peer-to-peer stack for code collaboration

Allow repos hosted on forges. (#453)

James Haydon779bc828d4e1
diff --git a/bin/rad-project b/bin/rad-project
index cc932b5..50ee389 100755
--- a/bin/rad-project
+++ b/bin/rad-project
@@ -73,13 +73,27 @@
(cd! name)
(set-git-config! "radicle.project-id" project)))
+(def setup-repo!
+ (fn []
+ (def question
+ (unlines
+ ["? What kind of repository would you like to use?"
+ "1. New peer-to-peer repository (git-ipfs **EXPERIMENTAL**)"
+ "2. Add your own remote (e.g.: github / gitlab / ...)"
+ " (see radicle.xyz/docs/storage for more info)\n"]))
+ (match (prompt! question)
+ "1" (init-git-ipfs-repo cid-of-empty-repo)
+ "2" (prompt! "Please input the remote git repo URL:")
+ _ (do (put-str! "You must select either 1 or 2.")
+ (exit! 1)))))
+
(def new-project!
"Create a new project."
(fn []
(def meta (prompt-for-metadata!))
(def project (create-project! meta))
(process! "git" ["init"] "")
- (def repo (init-git-ipfs-repo cid-of-empty-repo))
+ (def repo (setup-repo!))
(put-str! (string-append "=> adding \"origin\" remote: " repo))
(def issues (create-issues-machine!))
(put-str! "=> Assembled rad-issues machine")
diff --git a/test/e2e/DiffAppTest.hs b/test/e2e/DiffAppTest.hs
index 25581cc..1eebb54 100644
--- a/test/e2e/DiffAppTest.hs
+++ b/test/e2e/DiffAppTest.hs
@@ -13,7 +13,7 @@ test_diff_propose = testCaseSteps "diff propose" $ \step -> do
_ <- runTestCommand "rad-create-keys" []
_ <- runTestCommand "git" ["config", "--global", "user.name", "Alice"]
_ <- runTestCommand "git" ["config", "--global", "user.email", "[email protected]"]
- _ <- runTestCommand' "rad-project" ["init"] ["project-name", "project desc"]
+ _ <- runTestCommand' "rad-project" ["init"] ["project-name", "project desc", "1"]
_ <- runTestCommand "git" ["commit", "--allow-empty", "--message", "first commit"]
commitSha <- runTestCommand "git" ["rev-parse", "--short", "HEAD"]