commit 258db98d5427e99d9c7f7d248c180c0efbb8f814
Author: Simon Watson <spw01@protonmail.com>
Date: Fri Jul 16 20:54:54 2021 -0400
Little script to create a repo from the API in gogs
diff --git a/create_repo.pl b/create_repo.pl
new file mode 100755
index 0000000..43745bc
--- /dev/null
+++ b/create_repo.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $token = $ARGV[0];
+chomp $token;
+
+my $url = "https://git.spwbk.site/api/v1/";
+
+sub create_repo {
+ my $name = shift;
+
+ my $endpoint = "/user/repos";
+
+ my $curl_string = "curl -H \'Content-Type: application/json\' -X POST -d \'{\"name\": \"$name\", \"description\": \"$name\", \"private\": false}\' https://git.spwbk.site/api/v1/user/repos?token=$token";
+
+ print("$curl_string\n");
+ system($curl_string) == 0 or die "CURL ERROR with $name\n";
+
+}
+
+
+create_repo($ARGV[1]);