Commit graph

85 commits

Author SHA1 Message Date
glacambre
78e662efef
Add shellcheck to travis 2019-03-24 18:28:41 +01:00
glacambre
a287f82c7a
native/install.sh: Warn user on failure to create manifest/messenger
https://github.com/tridactyl/tridactyl/issues/1099 happened because of a
misconfigured $XDG_DATA_DIR. This could have been caught by checking
that the manifest and the messenger actually exist. This commit adds
these checks.

Closes #1099.
2019-02-11 07:25:29 +01:00
glacambre
a56c185935
native_main.py: Add ".txt" suffix to temporary file names
Reasons explained in https://github.com/tridactyl/tridactyl/issues/1204

Closes #1204
2018-12-12 07:14:20 +01:00
glacambre
698fc6ad36
Add FileSystem completion 2018-10-13 20:48:47 +01:00
glacambre
113fd9ef80
Implement loading themes from disk.
This fixes https://github.com/cmcaine/tridactyl/issues/491.
2018-10-08 14:47:06 +02:00
glacambre
f461d85d2f Add :saveas ex command
This commit adds a `:saveas` ex command that behaves mostly like
pentadactyl's `saveas`. This requires adding a new `move` primitive to
the native messenger which behaves like `cp` (but isn't actually a call
to `cp` in order to stay compatible with windows). Then
native_background.ts uses that in order to move files when their
download is complete.
2018-09-28 07:33:00 +02:00
Alex Griffin
e8f216f441 Some small fixes to the native messenger installer 2018-09-06 10:02:31 -05:00
Roman Bogorodskiy
d80ac1a32b FreeBSD support for native install
Handle FreeBSD's OSTYPE (which has "freebsdX.Y" format). While here,
convert OSTYPE check to use 'case' instead of if's/elif's.

For unknown OSTYPE fallback to the default Linux location.
2018-08-25 20:33:31 +04:00
William G Hatch
e77e2a07fb use /usr/bin/env to find bash 2018-08-24 13:38:49 -06:00
Noah Birnel
50fd234da2 fix native install on opensuse - issue 941
check $OSTYPE against "linux" as well as "linux-gnu"
2018-08-23 14:05:07 -07:00
André Klausnitzer
5cb26902e9
fix invalid syntax for os.path.join(... 2018-07-30 19:54:34 +02:00
Oliver Blanthorn
24a568d5d7
Fix wrong directory 2018-07-30 17:57:08 +01:00
Oliver Blanthorn
dd94e5a493
Fix #671: support _ prefix for RC, improve docs 2018-07-30 17:56:05 +01:00
Oliver Blanthorn
47f90395eb
Rerename Windows native install script 2018-07-25 14:39:59 +01:00
Jeff King
fb0bfc0807 native: feed stdin of subprocess for "run"
There's currently no way to tell the native messenger to
provide a particular stdin to a "run" command. This leads to
awkward uses of here-docs, which in turn require hacks like
the one in 4a5dcd7557.

Instead, let's take the "content" field from the message
body and feed that to the command's stdin, which gives us a
more robust channel for passing arbitrary bytes.

Note that we have to switch to using subprocess.Popen's
communicate() method, which will make sure we don't deadlock
if the input or output exceeds a pipe buffer.

Note also that when no stdin is provided by the caller
(i.e., all current cases), we'll pass an empty string. This
actually fixes a minor bug. Because we didn't override the
command's stdin argument, it's hooked to the messenger's
stdin, which is the pipe coming from firefox. If the command
tries to read, it (and the messenger) will hang forever,
since firefox is waiting for the messenger to respond before
writing anything else.

I bumped the native messenger version. This is mostly
backwards compatible (existing callers just don't send any
stdin content at all). But a caller that wants to send stdin
should check to make sure we have at least 0.1.7.
2018-07-18 01:18:13 -04:00
Jeff King
a9fb9b65e9 native: use os.join instead of backslashes for debug path
This makes debugging work correctly on Linux.  Otherwise
you'll generally get EPERM as `/home/user\.tridactyl` is a
path in `/home`, which you likely don't have access to
write.
2018-07-18 01:03:12 -04:00
Babil Golam Sarwar
92e99aabbb
Add support to enforce minimum version for PowerShell 2018-07-13 08:46:09 +10:00
Babil Golam Sarwar
02c76e0f00
Fix PowerShell auto-close when native-messenger installation fails 2018-07-11 17:08:44 +10:00
Babil Golam Sarwar
be245d5dfa
Add TLS 1.1/1.2 support to Invoke-WebRequest 2018-07-11 11:37:34 +10:00
Vladimir Macko
2fc9eb0c54 Fix bug introduced in #733 2018-06-25 15:43:14 +02:00
Babil Golam Sarwar
54aca0fcf7
Merge branch 'master' of https://github.com/cmcaine/tridactyl 2018-06-25 07:42:31 +10:00
Babil Golam Sarwar
e0c61d53c5
Fixes Non-ASCII username issue reported in #731 2018-06-25 07:41:58 +10:00
Vladimir Macko
310f7b5900 Improve robustness of Get-PythonVersionStatus 2018-06-24 01:14:01 +02:00
Babil Golam Sarwar
683c3dc086 Fix native_main.py URL in win_install.ps1 2018-06-08 14:54:23 +10:00
Oliver Blanthorn
173e4fe896
Make gen_native_message executable 2018-05-30 11:25:05 +01:00
Babil Golam Sarwar
1f7c042d64 Merge branch 'master' into gsbabil/fix-restart-command-on-windows 2018-05-29 12:38:03 +10:00
Babil Golam Sarwar
75f21da384 Add consistent Python formatting 2018-05-29 12:08:08 +10:00
Oliver Blanthorn
2cc5662764
Output exe in artifacts with xpis etc 2018-05-28 14:00:05 +01:00
Oliver Blanthorn
e0810c5694
Remove old files 2018-05-28 13:16:25 +01:00
Babil Golam Sarwar
65b9275667
Add native message maker 2018-05-28 11:17:47 +01:00
Babil Golam Sarwar
47d247aff7 Fix restart on Windows without needing Firefox on %PATH% 2018-05-28 00:32:30 +10:00
Babil Golam Sarwar
9d5ce40505 Remove -ProfileManager and -new-tab during Firefox restart 2018-05-27 10:19:26 +10:00
Babil Golam Sarwar
93ca6c50a6 Fix :restart under restricted PowerShell 2018-05-26 10:18:23 +10:00
Babil Golam Sarwar
d81f503259 Use -new-tab to activate Tridactyl on restart 2018-05-25 14:06:29 +10:00
Babil Golam Sarwar
00baee326f Fix "parent.lock" path and Firefox restart params 2018-05-24 17:23:59 +10:00
Babil Golam Sarwar
66444af20a Refactor and clean-up Python codes 2018-05-24 13:06:41 +10:00
Babil Golam Sarwar
fdc6f77b65 Merge branch 'master' into gsbabil/fix-restart-command-on-windows 2018-05-23 18:59:32 +10:00
Babil Golam Sarwar
c30327f73e Fix :restart command on Windows 2018-05-23 18:08:47 +10:00
Babil Golam Sarwar
abd4a7546c Remove test_native_main.py from this PR branch 2018-05-21 12:09:04 +10:00
Babil Golam Sarwar
2f4ddc033e Add minor Windows specific revises to build.sh 2018-05-20 09:32:31 +10:00
Babil Golam Sarwar
a940453958 Add -NoPython flag support to win_install.ps1
This patch replaces the previous `-UsePython` flag with `-NoPython`.
Essentially this flag replaces the native messenger installation
behavior with the following new strategy on Windows:

  * Look for Python-3 in user's Windows environment

    - If Python-3 is found, install `native_main.py` as the native
      messenger binary

    - If Python-3 is _not_ found, install `native_main.exe` as the
      native messenger binary
2018-05-20 06:21:35 +10:00
Babil Golam Sarwar
2f8689cf3d Add OpenPGP signature support for native_main.exe 2018-05-19 14:14:32 +10:00
Babil Golam Sarwar
f31184fb2e Add test script for native_main.py
An example usage of `test_native_main.py` is added below:

```
  $ ./test_native_main.py "version" | ./native_main.py

  {"version": "0.1.5"}
```
2018-05-18 18:32:56 +10:00
Babil Golam Sarwar
42f5c3d3ca Refactor download URI location in win_install.ps1 2018-05-18 13:37:30 +10:00
Babil Golam Sarwar
bf920989f3 Add compiled native_main.exe support on Windows
This commit adds support for comiling `native_main.py` into
`native_main.exe` using [PyInstaller][0].

By default, the Powershell installer script would use the compiled
EXE version for Windows. However, the old behaviour can achieved by
using the `-UsePython` flag to `win_install.ps1`.

Currently, the `native_main.exe` is built every time
`scripts/build.sh` is invoked. However, this behavior can be
adjusted by invoking the build script as shown below:

```
  PYINSTALLER="0" npm run build
```

[0]: https://www.pyinstaller.org
2018-05-18 11:44:01 +10:00
Oliver Blanthorn
cb349b477e
Bump native version 2018-05-17 17:34:02 +01:00
Michal Koutný
98df8fff8e
Fix native_main 'temp' command for python < 3.5.0
We are passing None value to mkstemp which is only possible since python
3.5.0 [1]. Let's use our own mask with empty string as the prefix when
None is given. That works with both python API versions.

[1]
ad577b938b
2018-05-17 17:33:36 +01:00
Oliver Blanthorn
17a1b318a6
Ours is not to reason why: fix #544 2018-05-17 13:54:56 +01:00
Babil Golam Sarwar
aee6d59e01
Fix minor typo 2018-05-17 12:19:55 +01:00
Babil Golam Sarwar
32e74a0e76
Fix some minor typo and lint errors 2018-05-17 12:19:54 +01:00