fix: replace default github branch

pull/331/head
Seaton Jiang 2020-10-04 12:12:50 +08:00
parent b0ae3c9491
commit 4a71ab3b10
No known key found for this signature in database
GPG Key ID: C1086BAE716FF138
11 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<img src="https://raw.githubusercontent.com/vtrois/kratos/master/assets/img/options/about.png">
<img src="https://raw.githubusercontent.com/vtrois/kratos/main/assets/img/options/about.png">
</p>
<p align="center">
@ -189,11 +189,11 @@ Detailed changes for each release are documented in the [release notes](https://
If you find Kratos useful, you can buy us a cup of coffee
<p align="center">
<img width="700" src="https://raw.githubusercontent.com/vtrois/kratos/master/assets/img/options/donate.png">
<img width="700" src="https://raw.githubusercontent.com/vtrois/kratos/main/assets/img/options/donate.png">
</p>
## License
The code is available under the [MIT](https://github.com/vtrois/kratos/blob/master/LICENSE) license.
The code is available under the [MIT](https://github.com/vtrois/kratos/blob/main/LICENSE) license.
The document is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nc-nd/4.0/).

View File

@ -246,7 +246,7 @@ class Options_Framework_Interface
<h4>' . __('讨论交流', 'kratos') . '</h4>
<img src="' . ASSET_PATH . '/assets/img/options/discuss.png">
<h4>' . __('版权声明', 'kratos') . '</h4>
<p>' . __('主题源码使用 <a href="https://github.com/vtrois/kratos/blob/master/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。', 'kratos') . '</p>
<p>' . __('主题源码使用 <a href="https://github.com/vtrois/kratos/blob/main/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。', 'kratos') . '</p>
<h4>' . __('打赏支持', 'kratos') . '</h4>
<img src="' . ASSET_PATH . '/assets/img/options/donate.png">
</div>';

View File

@ -59,7 +59,7 @@ if ( !class_exists('Puc_v4p9_Vcs_Api') ):
* @param string $ref Tag or branch name.
* @return array Parsed readme.
*/
public function getRemoteReadme($ref = 'master') {
public function getRemoteReadme($ref = 'main') {
$fileContents = $this->getRemoteFile($this->getLocalReadmeName(), $ref);
if ( empty($fileContents) ) {
return array();
@ -196,7 +196,7 @@ if ( !class_exists('Puc_v4p9_Vcs_Api') ):
* @param string $ref
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
*/
abstract public function getRemoteFile($path, $ref = 'master');
abstract public function getRemoteFile($path, $ref = 'main');
/**
* Get the timestamp of the latest commit that changed the specified branch or tag.

View File

@ -3,7 +3,7 @@ if ( !interface_exists('Puc_v4p9_Vcs_BaseChecker', false) ):
interface Puc_v4p9_Vcs_BaseChecker {
/**
* Set the repository branch to use for updates. Defaults to 'master'.
* Set the repository branch to use for updates. Defaults to 'main'.
*
* @param string $branch
* @return $this

View File

@ -42,7 +42,7 @@ if ( !class_exists('Puc_v4p9_Vcs_BitBucketApi', false) ):
$updateSource = $this->getStableTag($configBranch);
//Look for version-like tags.
if ( !$updateSource && ($configBranch === 'master') ) {
if ( !$updateSource && ($configBranch === 'main') ) {
$updateSource = $this->getLatestTag();
}
//If all else fails, use the specified branch itself.
@ -156,7 +156,7 @@ if ( !class_exists('Puc_v4p9_Vcs_BitBucketApi', false) ):
* @param string $ref
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
*/
public function getRemoteFile($path, $ref = 'master') {
public function getRemoteFile($path, $ref = 'main') {
$response = $this->api('src/' . $ref . '/' . ltrim($path));
if ( is_wp_error($response) || !is_string($response) ) {
return null;

View File

@ -164,7 +164,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
* @param string $ref Reference name (e.g. branch or tag).
* @return StdClass|null
*/
public function getLatestCommit($filename, $ref = 'master') {
public function getLatestCommit($filename, $ref = 'main') {
$commits = $this->api(
'/repos/:user/:repo/commits',
array(
@ -264,7 +264,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
* @param string $ref
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
*/
public function getRemoteFile($path, $ref = 'master') {
public function getRemoteFile($path, $ref = 'main') {
$apiUrl = '/repos/:user/:repo/contents/' . $path;
$response = $this->api($apiUrl, array('ref' => $ref));
@ -280,7 +280,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
* @param string $ref
* @return string
*/
public function buildArchiveDownloadUrl($ref = 'master') {
public function buildArchiveDownloadUrl($ref = 'main') {
$url = sprintf(
'https://api.github.com/repos/%1$s/%2$s/zipball/%3$s',
urlencode($this->userName),
@ -319,7 +319,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitHubApi', false) ):
public function chooseReference($configBranch) {
$updateSource = null;
if ( $configBranch === 'master' ) {
if ( $configBranch === 'main' ) {
//Use the latest release.
$updateSource = $this->getLatestRelease();
if ( $updateSource === null ) {

View File

@ -238,7 +238,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
* @param string $ref
* @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error.
*/
public function getRemoteFile($path, $ref = 'master') {
public function getRemoteFile($path, $ref = 'main') {
$response = $this->api('/:id/repository/files/' . $path, array('ref' => $ref));
if ( is_wp_error($response) || !isset($response->content) || $response->encoding !== 'base64' ) {
return null;
@ -253,7 +253,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
* @param string $ref
* @return string
*/
public function buildArchiveDownloadUrl($ref = 'master') {
public function buildArchiveDownloadUrl($ref = 'main') {
$url = sprintf(
'%1$s://%2$s/api/v4/projects/%3$s/repository/archive.zip',
$this->repositoryProtocol,
@ -289,7 +289,7 @@ if ( !class_exists('Puc_v4p9_Vcs_GitLabApi', false) ):
$updateSource = null;
// GitLab doesn't handle releases the same as GitHub so just use the latest tag
if ( $configBranch === 'master' ) {
if ( $configBranch === 'main' ) {
$updateSource = $this->getLatestTag();
}

View File

@ -3,9 +3,9 @@ if ( !class_exists('Puc_v4p9_Vcs_PluginUpdateChecker') ):
class Puc_v4p9_Vcs_PluginUpdateChecker extends Puc_v4p9_Plugin_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
/**
* @var string The branch where to look for updates. Defaults to "master".
* @var string The branch where to look for updates. Defaults to "main".
*/
protected $branch = 'master';
protected $branch = 'main';
/**
* @var Puc_v4p9_Vcs_Api Repository API client.

View File

@ -4,9 +4,9 @@ if ( !class_exists('Puc_v4p9_Vcs_ThemeUpdateChecker', false) ):
class Puc_v4p9_Vcs_ThemeUpdateChecker extends Puc_v4p9_Theme_UpdateChecker implements Puc_v4p9_Vcs_BaseChecker {
/**
* @var string The branch where to look for updates. Defaults to "master".
* @var string The branch where to look for updates. Defaults to "main".
*/
protected $branch = 'master';
protected $branch = 'main';
/**
* @var Puc_v4p9_Vcs_Api Repository API client.

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"Project-Id-Version: Kratos\n"
"POT-Creation-Date: 2020-09-30 18:27+0800\n"
"POT-Creation-Date: 2020-10-04 12:12+0800\n"
"PO-Revision-Date: 2020-02-14 23:32+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -181,7 +181,7 @@ msgstr ""
#: inc/options-framework/includes/class-options-interface.php:249
msgid ""
"主题源码使用 <a href=\"https://github.com/vtrois/kratos/blob/master/LICENSE"
"主题源码使用 <a href=\"https://github.com/vtrois/kratos/blob/main/LICENSE"
"\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://"
"creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC BY-NC-ND "
"4.0</a> 进行许可。"

View File

@ -9,5 +9,5 @@ Author: Seaton Jiang
Author URI: https://www.vtrois.com/
Theme URI: https://github.com/vtrois/kratos
License: MIT License
License URI: https://github.com/vtrois/kratos/blob/master/LICENSE
License URI: https://github.com/vtrois/kratos/blob/main/LICENSE
*/