# -*- coding: utf-8 -*-
# Copyright (c) 2019, JINGROW
# For license information, please see license.txt


import jingrow


def execute():
	jingrow.reload_pagetype("Jingrow App")
	apps = jingrow.get_all(
		"Jingrow App", fields=["name", "url"], filters={"repo": ("is", "not set")}
	)
	for app in apps:
		repo = app.url.split("/")[-1].replace(".git", "")
		jingrow.db.set_value("Jingrow App", app.name, "repo", repo)
