Skip to content

Commit

Permalink
Document how to install the nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 17, 2021
1 parent 9eebd2c commit 9f4f227
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
20 changes: 20 additions & 0 deletions docs/binary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ particular desktop, but it should work for most major desktop environments.
Customizing the installation
--------------------------------

.. _nightly:

* You can install the latest nightly kitty build with ``installer``:

.. parsed-literal::
:class: pre
|ins| \\
installer=nightly
If you want to install it in parallel to the released kitty specify a
different install locations with ``dest``:

.. parsed-literal::
:class: pre
|ins| \\
installer=nightly dest=/some/other/location
* You can specify a different install location, with ``dest``:

.. parsed-literal::
Expand All @@ -88,6 +107,7 @@ Customizing the installation
|ins| \\
installer=/path/to/dmg or tarball
Uninstalling
----------------

Expand Down
3 changes: 3 additions & 0 deletions docs/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Build from source
|kitty| is designed to run from source, for easy hack-ability. Make sure
the following dependencies are installed first.

.. note::
If you just want to test the latest changes to kitty you dont need to build
from source. Instead install the :ref:`latest nightly build <nightly>`.

.. note::
If you are making small changes only to the python parts of kitty, there is no need to
Expand Down
17 changes: 14 additions & 3 deletions docs/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ def __call__(self, blocks, block_size, total_size):
# }}}


def get_nightly_url():
base = 'https://github.com/kovidgoyal/kitty/releases/download/nightly/kitty-nightly'
if is_macos:
return base + '.dmg'
arch = 'x86_64' if is64bit else 'i686'
return base + '-' + arch + '.txz'


def get_latest_release_data():
print('Checking for latest release on GitHub...')
req = urllib.Request('https://api.github.com/repos/kovidgoyal/kitty/releases/latest', headers={'Accept': 'application/vnd.github.v3+json'})
Expand Down Expand Up @@ -194,9 +202,12 @@ def main(dest=None, launch=True, installer=None):
url, size = get_latest_release_data()
installer = download_installer(url, size)
else:
installer = os.path.abspath(installer)
if not os.access(installer, os.R_OK):
raise SystemExit('Could not read from: {}'.format(installer))
if installer == 'nightly':
url = get_nightly_url()
else:
installer = os.path.abspath(installer)
if not os.access(installer, os.R_OK):
raise SystemExit('Could not read from: {}'.format(installer))
if is_macos:
macos_install(installer, dest=dest, launch=launch)
else:
Expand Down
7 changes: 5 additions & 2 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,11 @@ def update_nightly_description(self, release_id: int) -> None:
now = str(datetime.datetime.utcnow()).split('.')[0] + ' UTC'
with open('.git/refs/heads/master') as f:
commit = f.read().strip()
self.patch(url, 'Failed to update nightly release description',
body=f'Nightly release, generated on: {now} from commit: {commit}')
self.patch(
url, 'Failed to update nightly release description',
body=f'Nightly release, generated on: {now} from commit: {commit}.'
' For how to install nightly builds, see: https://sw.kovidgoyal.net/kitty/binary/#customizing-the-installation'
)

def __call__(self) -> None:
releases = self.releases()
Expand Down

0 comments on commit 9f4f227

Please sign in to comment.