Skip to content

Commit

Permalink
committi pitti
Browse files Browse the repository at this point in the history
  • Loading branch information
essingen123 committed Aug 20, 2024
1 parent 8f23f02 commit d7b375c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
34 changes: 28 additions & 6 deletions autogit4unimoose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
./a.sh # deletas all for a restart
declare -g owner_slash_repo_global_var_set_onload_kigit github_pages_repo_url
declare -gA global_conf

echo "to switch main branch to main from master use: gh repo edit --default-branch main"
# Fun and colorful output with emojis
# Set up colors and formatting
fun_echo() {
Expand Down Expand Up @@ -489,11 +489,33 @@ def create_html_page(repo_name):
print('README.md not found.')
def check_github_pages(repo_name, token):
headers = {'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'}
response = requests.get(f'https://api.github.com/repos/{repo_name}/pages', headers=headers)
if response.status_code == 404:
init_git_repo_localhub_pages(repo_name, token)
headers = {'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'}
response = requests.get(f'https://api.github.com/repos/{repo_name}/pages', headers=headers)
# Check for special row in kigit.txt
with open('kigit.txt', 'r') as kigit_file:
kigit_lines = kigit_file.readlines()
special_row_found = False
with open('kigit.txt', 'w') as kigit_file_write:
for line in kigit_lines:
if line.startswith('#909303Q2x'):
# Force GitHub Pages initialization
init_git_repo_localhub_pages(repo_name, token)
print("Special row detected and processed. GitHub Pages initialized.")
special_row_found = True
else:
kigit_file_write.write(line)
if not special_row_found:
# Handle regular GitHub Pages checks
if response.status_code == 404:
init_git_repo_localhub_pages(repo_name, token)
elif response.status_code == 200:
print("GitHub Pages is already enabled.")
else:
print(f"Error checking GitHub Pages: Status code {response.status_code}")
def init_git_repo_localhub_pages(repo_name, token):
headers = {'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'}
data = {'source': {'branch': 'main', 'path': '/'}}
Expand Down
2 changes: 1 addition & 1 deletion templates/a_1_template_README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# autogit4unimoose
# panik_button_cooler
<!-- ![Image](github_repo_image.webp) -->

## Description
Expand Down
8 changes: 4 additions & 4 deletions templates/a_1_template_index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<html lang="en">
<meta name="viewport" content="width=device-width">
<!DOCTYPE html>
<html>
<head>
<title>template</title><link rel="stylesheet" href="https://essingen123.github.io/cssGuden/html_auto_style_factor_parameter_cool_party_2_of_30.css">
<title>panik_button_cooler</title>
</head>
<body>
<h1>hmm probably not wokring?</h1>
<h1>panik_button_cooler</h1>
<p>A work in progress with automation testing for Git leveraging python, bash etc</p>
</body>
</html>
4 changes: 2 additions & 2 deletions templates/a_1_template_kigit4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set303a=y
set303i=y

# git-reponame (empty for current folder name, 'random' for a random name)
set303b=any_or_most_videos_in_a_folder_to_gif_linux_ubuntu
set303b=pannkaka_bankbank

# public git (private for private, public for public)
set303c=private
Expand All @@ -23,7 +23,7 @@ set303e=Git, Bash, Automation, Automagic, un-PEP8-perhaps
set303f=A work in progress with automation testing for Git leveraging python, bash etc

# website URL
set303g=https://essingen123.github.io/any_or_most_videos_in_a_folder_to_gif_linux_ubuntu
set303g=https://essingen123.github.io/pannkaka_bankbank

# GithubPartywebpageLink
set303h=index.html
Expand Down

0 comments on commit d7b375c

Please sign in to comment.