Skip to content

Commit

Permalink
fix: replace default github branch
Browse files Browse the repository at this point in the history
  • Loading branch information
seatonjiang committed Oct 4, 2020
1 parent b0ae3c9 commit 4a71ab3
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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">
Expand Down Expand Up @@ -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/).
2 changes: 1 addition & 1 deletion inc/options-framework/includes/class-options-interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static function optionsframework_fields()
<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>';
Expand Down
4 changes: 2 additions & 2 deletions inc/update-checker/Puc/v4p9/Vcs/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract public function chooseReference($configBranch);
* @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();
Expand Down Expand Up @@ -196,7 +196,7 @@ protected function compareTagNames($tag1, $tag2) {
* @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.
Expand Down
2 changes: 1 addition & 1 deletion inc/update-checker/Puc/v4p9/Vcs/BaseChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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
Expand Down
4 changes: 2 additions & 2 deletions inc/update-checker/Puc/v4p9/Vcs/BitBucketApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function chooseReference($configBranch) {
$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.
Expand Down Expand Up @@ -156,7 +156,7 @@ protected function getDownloadUrl($ref) {
* @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;
Expand Down
8 changes: 4 additions & 4 deletions inc/update-checker/Puc/v4p9/Vcs/GitHubApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getBranch($branchName) {
* @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(
Expand Down Expand Up @@ -264,7 +264,7 @@ protected function buildApiUrl($url, $queryParams) {
* @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));

Expand All @@ -280,7 +280,7 @@ public function getRemoteFile($path, $ref = 'master') {
* @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),
Expand Down Expand Up @@ -319,7 +319,7 @@ public function setAuthentication($credentials) {
public function chooseReference($configBranch) {
$updateSource = null;

if ( $configBranch === 'master' ) {
if ( $configBranch === 'main' ) {
//Use the latest release.
$updateSource = $this->getLatestRelease();
if ( $updateSource === null ) {
Expand Down
6 changes: 3 additions & 3 deletions inc/update-checker/Puc/v4p9/Vcs/GitLabApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ protected function buildApiUrl($url, $queryParams) {
* @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;
Expand All @@ -253,7 +253,7 @@ public function getRemoteFile($path, $ref = 'master') {
* @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,
Expand Down Expand Up @@ -289,7 +289,7 @@ public function chooseReference($configBranch) {
$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();
}

Expand Down
4 changes: 2 additions & 2 deletions inc/update-checker/Puc/v4p9/Vcs/PluginUpdateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

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.
Expand Down
4 changes: 2 additions & 2 deletions inc/update-checker/Puc/v4p9/Vcs/ThemeUpdateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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.
Expand Down
4 changes: 2 additions & 2 deletions languages/kratos.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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> 进行许可。"
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

0 comments on commit 4a71ab3

Please sign in to comment.