-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
does not work on multiple files #8
Comments
@dnamyslak Hi, what is the |
i am using node express with yarp and sharp resolution ( to exclude the other issue I mentioned ) { and using your function in bin/www.js svgfixerFixExample(); async function svgfixerFixExample() { works fine but just witn explicit ONE file so I needet to change for each filename and run this several times does not work when tried to use => await svgfixer.fix('svg', 'svg/fixed-svgs'); |
svgfixer.fix('path/to/folder/with/multiple/svgs', 'path/to/store/fixed/svgs')
.then(() => {
console.log('finished')
})
.catch((error) => {
console.log(error)
})
|
@dnamyslak could I also see what |
`#!/usr/bin/env node /**
var app = require('../app'); /**
var port = normalizePort(process.env.PORT || '3000'); /**
var server = http.createServer(app); /**
server.listen(port); /**
function normalizePort(val) { if (isNaN(port)) { if (port >= 0) { return false; /**
function onError(error) { var bind = typeof port === 'string' // handle specific listen errors with friendly messages /**
function onListening() { svgfixerFixExample(); async function svgfixerFixExample() { |
@dnamyslak is the |
the svg folder is 1 level up |
svgfixer.fix('X:\\DAVEN\\nodejs\\svg', 'X:\\DAVEN\\nodejs\\svg\\fixed-svgs2')
.then(() => {
console.log('finished')
})
.catch((error) => {
console.log(error)
})
this does not work either
it says finished
but no files in fixed-svgs2
Od: Ghustavh <notifications@github.com>
Wysłano: niedziela, 7 czerwca 2020 23:01
Do: oslllo/svg-fixer <svg-fixer@noreply.github.com>
DW: Dawid Namyslak <davenam@wp.pl>; Mention <mention@noreply.github.com>
Temat: Re: [oslllo/svg-fixer] does not work on multiple files (#8)
@dnamyslak <https://github.com/dnamyslak>
* await only works inside async functions
* You can try this.
svgfixer.fix('path/to/folder/with/multiple/svgs', 'path/to/store/fixed/svgs')
.then(() => {
console.log('finished')
})
.catch((error) => {
console.log(error)
})
* If you want to fix all svg files in a folder do not include the .svg at the end of the path, just pass in the directory/folder path like this: path/to/folder not path/to/folder.svg
* My paths use / because i'm on ubuntu, if you are on windows use \ or just copy the folder path from explorer.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#8 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AE2URPR3SWH7SQMKMTDN6FDRVP5YDANCNFSM4NXCDMSA> . <https://github.com/notifications/beacon/AE2URPSKAT47YWDPK3ZMI4DRVP5YDA5CNFSM4NXCDMSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEYU6FLY.gif>
|
@dnamyslak Glad to hear that is solved that issue for you too, but I really don't want you do have to do the icons one by one, especially if the app supports doing a whole folder. If you only want to fix icons you don't need
"scripts": {
"fixer": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
const svgfixer = require("oslllo-svg-fixer");
var source = "path/to/folder/with/multiple/svgs";
var destination = "path/to/store/fixed/svgs";
var options = {
throwIfPathDoesNotExist: true,
showProgressBar: true,
};
svgfixer.fix(source, destination, options)
.then(() => {
console.log("Finished fixing svgs")
})
.catch((err) => {
console.log("Error fixing svgs")
console.log(err)
})
|
@dnamyslak fixed the multiple bugs with the issue, update and try the latest version, |
Just a small correction on the above wrong code: SVGfixer(source, destination, options).fix()
.then(() => {
console.log("Finished fixing svgs");
})
.catch((err) => {
console.log("Error fixing svgs");
console.log(err);
}); |
It just works with 1 specified file.
Not working with whole folder
The text was updated successfully, but these errors were encountered: