-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows cmd.exe and Powershell support #5
Comments
I'm not sure, it'll likely require changes to run in a Windows env. From what I've read, cmd.exe may not support ANSI escape codes before Windows 10, and in Windows 10 you may need to configure ANSI support yourself. |
Ok. But Powershell does support ANSI escape codes. Check https://github.com/PoshCode/Pansies. |
Ok. Have you tried installing or using on Windows? What errors did you get? |
Please specify the steps to install the dependencies on Windows. |
According to the code dependencies are installed by setup.py Change directory to gif-for-cli : Then install the dependencies using setup.py: |
If you do that you'll end up with:
Traceback (most recent call last):
File "setup.py", line 33, in
os.symlink('../third_party', symlink_path)
AttributeError: 'module' object has no attribute 'symlink'
|
Due to some peculiarities with the way Python packing works, the install script has to temporarily create a symbolic link to that dir. It'll probably have to change for Windows. If you guys want to work on a PR for Windows support it would be much appreciated. :) |
Why is a symbolic link needed for third party dependencies at all. Can't it just be packaged as a single folder? |
I needed to include a font for the export feature, and it's Google policy to put all 3rd party code in the third_party dir. I tried a number of different ways, but I couldn't get that directory to consistently be included in the .whl and .tar.gz distributions. The best way to ensure the needed files would be available after install was to make it a Python module, but I didn't want |
Seems a bit daft but I guess you could add Windows support for symlink...though that would require an elevated command prompt to install.
if os.name == "nt":
def symlink_ms(source, link_name):
import ctypes
csl = ctypes.windll.kernel32.CreateSymbolicLinkW
csl.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32)
csl.restype = ctypes.c_ubyte
flags = 1 if os.path.isdir(source) else 0
try:
if csl(link_name, source.replace('/', '\\'), flags) == 0:
raise ctypes.WinError()
except:
pass
os.symlink = symlink_ms
|
As per Windows 10 Creators Update, elevated command prompt is not mandatory anymore to create symlinks. Refer, this. |
Linux subsystem on Windows works with this at present.Type bash in cmd.exe (yeah it's still in cmd.exe) and deploy it like Linux. |
How can this be run on Windows cmd.exe and Powershell?
The text was updated successfully, but these errors were encountered: