Load json args in cmd version
Arti3DPlayer opened this issue · 21 comments
And aslo in my package.json file i have settings:
"webexe_settings": {
"blacklist": ".git\n.gitignore\nnw.js_package\ncompile.bat\n",
"custom_script": "",
"download_dir": "",
"export_dir": "",
"force_download": false,
"linux-x32": true,
"linux-x64": true,
"mac-x64": true,
"nw_compression_level": 9,
"nw_version": "0.19.5",
"output_pattern": "",
"sdk_build": false,
"uncompressed_folder": false,
"whitelist": "",
"windows-x32": true,
"windows-x64": true
}
How do i can load it with cmd version ? Because --blacklist
not working for me
--package-json
option doesn't work too
Updating nw versions...
Done.
error: the following arguments are required: --nw-version, --main, --export-to
All my attempts to add blacklist failed :(
You're right. I'm going to look into this when I get the chance. I forgot to add the option in the command line version to load the blacklist. Technically it should work, but there must be something going wrong.
@jyapayne i have looked sources and it is really should work. But didn't build project myself. I use linux cmd, maybe this is issue ?
No, that shouldn't be an issue. It should work the same as the GUI version. I'll take a look at it later and see if I can figure it out. I suspect there is an error in logic somewhere.
@Arti3DPlayer I looked at the code, and it looks like the CMD version expects comma separated values. But it should really be the same values for both the GUI and CMD. As a workaround for now, please use --blacklist=".git,.gitignore,nw.js_package,compile.bat"
Sorry but blacklist from json still not working:
./web2exe-linux /home/myapp --package-json /homemyapp/package.json --nw-version 0.19.5 --main app/index.html --export-to mac-x64
package.json
"webexe_settings": {
"blacklist": ".git, .gitignore, nw.js_package, compile.bat, start.bat, start.sh, PSDs, web2exe",
"linux-x32": true,
"linux-x64": true,
"mac-x64": true,
"nw_version": "0.19.5",
"output_pattern": "%(app_name) v%(version)",
"sdk_build": false,
"whitelist": "",
"windows-x32": true,
"windows-x64": true
},```
And it doesn't work at all :( --blacklist ".git, .gitignore, nw.js_package, compile.bat, start.bat, start.sh"
Make sure that there are no spaces in between the commas (or newlines). Also, if you are using the new version that I uploaded yesterday, you have to use newlines.
@jyapayne I i use latest 0.6.2b
So do like this in json:
"blacklist": ".git\ngitignore\nnw.js_package\ncompile.bat\nstart.bat\nstart.sh\nPSDs\nweb2exe",
Not working too
Could you please add log to show what files (with path) has been ignored
@Arti3DPlayer The latest is 0.6.2b. I could show a log of what files have been ignored, yes. I could add that as a logging message to better show what's going on. That's a good idea :)
@jyapayne could you please add this log line :( Really need your builder
First, did you try with the latest version 0.6.2? I updated it yesterday. I'll add the log line tonight.
@Arti3DPlayer I must apologize. It looks like I made a mistake with the latest build and the blacklist is still not behaving from the command line. I will fix it in addition to adding the logging.
@Arti3DPlayer I've made changes and have replaced the downloads for 0.6.2b with the versions that were supposed to work. The files now blacklist and whitelist properly with both commas and newlines as separators.
If you want to exclude a directory at the root, say .git
, you'll have to use --blacklist=".git*"
. Example:
--blacklist="stuff.js,.git*,*__pycache__*"
and --blacklist="stuff.js\n.git*\n*__pycache__*"
are both the same. If your project is /home/arti/Project
, then the files blacklisted are Project/stuff.js
, the Project/.git
folder, and any files or folders containing __pycache__
in any recursive directory.
You can also view the logs with --verbose
in the command line, which will tell you which folders and files were skipped and kept (if whitelist is defined).
@jyapayne sorry, but not working yet...
"webexe_settings": {
"blacklist": ".git*\n.gitignore\nnw.js_package*\ncompile.bat\nstart.bat\nstart.sh\nsign.sh\nPSDs*\nweb2exe*\n.idea*\n.DS_Store",
"custom_script": "",
"download_dir": "",
"export_dir": "output",
"force_download": false,
"linux-x32": false,
"linux-x64": false,
"mac-x64": true,
"nw_compression_level": 0,
"nw_version": "0.19.5",
"output_pattern": "%(app_name) v%(version)",
"sdk_build": false,
"uncompressed_folder": false,
"whitelist": "",
"windows-x32": false,
"windows-x64": false
},
run this config with latest gui v0.6.2b on mac works perfectly. Run the same with:
./web2exe/0.6.2b/Web2ExeMac-CMD/web2exe-mac ~/Jscode/rf_configurator --package-json ~/Jscode/rf_configurator/package.json --nw-version 0.19.5 --main app/index.html --export-to mac-x64 --verbose
It ignore only output file.
DEBUG util_classes.py 126: Blacklist pattern:
DEBUG util_classes.py 127: ['.git*\n'
'.gitignore\n'
'nw.js_package*\n'
'compile.bat\n'
'start.bat\n'
'start.sh\n'
'sign.sh\n'
'PSDs*\n'
'web2exe*\n'
'.idea*\n'
'.DS_Store',
'*output*']
DEBUG util_classes.py 128:
DEBUG util_classes.py 129: Whitelist pattern:
DEBUG util_classes.py 130: ['']
DEBUG util_classes.py 131:
DEBUG util_classes.py 147: Skipping dir: output
INFO command_line.py 1148: Copying files to /Users/artemhruzd/Jscode/rf_configurator
For example folder: nw.js_package has same level with package.json and other files too
I could fix this by myself in code, but i can't install python3.4 into virtual env, because i have 3.5)
oh, figure it out. Need \\n
instead of \n
@Arti3DPlayer I apologize! I had the regex trying to support newlines from the command line args. Instead, I've just updated the code to only work with commas (,) from the command line option (--blacklist
) and newlines or commas from the package.json file. It seems reasonable to me :)