mirror of
https://github.com/RGBCube/GitHub2Forgejo
synced 2025-06-17 18:52:09 +00:00
Better if arm placement
This commit is contained in:
parent
2805a41c63
commit
e5976fcaed
1 changed files with 6 additions and 6 deletions
12
migrate.nu
12
migrate.nu
|
@ -61,19 +61,19 @@ def main [
|
||||||
$repo_urls | each {|url|
|
$repo_urls | each {|url|
|
||||||
let repo_name = $url | split row "/" | last
|
let repo_name = $url | split row "/" | last
|
||||||
|
|
||||||
let repo_is_private = if $github_token != "" {
|
let repo_is_private = if $github_token == "" {
|
||||||
|
false
|
||||||
|
} else {
|
||||||
(
|
(
|
||||||
http get ("https://api.github.com/repos/" + $github_user + "/" + $repo_name)
|
http get ("https://api.github.com/repos/" + $github_user + "/" + $repo_name)
|
||||||
-H [ Authorization $"token ($github_token)" ]
|
-H [ Authorization $"token ($github_token)" ]
|
||||||
).private
|
).private
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = if $repo_is_private {
|
let url = if not $repo_is_private {
|
||||||
$"https://($github_token)@github.com/($github_user)/($repo_name)"
|
|
||||||
} else {
|
|
||||||
$url
|
$url
|
||||||
|
} else {
|
||||||
|
$"https://($github_token)@github.com/($github_user)/($repo_name)"
|
||||||
}
|
}
|
||||||
|
|
||||||
print --no-newline $"(ansi blue)($strategy | str replace "ed" "ing") ([public private] | get ($repo_is_private | into int)) repository to ($gitea_url)/($gitea_user)/($repo_name)..."
|
print --no-newline $"(ansi blue)($strategy | str replace "ed" "ing") ([public private] | get ($repo_is_private | into int)) repository to ($gitea_url)/($gitea_user)/($repo_name)..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue