Giter Club home page Giter Club logo

abandoned-strings's People

Contributors

devsc avatar hlung avatar ijoshsmith avatar sterlingwes avatar xaphod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abandoned-strings's Issues

Executable file doesn't execute

When i try to execute the command line in terminal knowing that im in the directory, help me plz i need this tool.
-bash: ./AbandonedStrings: is a directory

String(contentsOfFile: filePath) failed : couldn’t be opened because you don’t have permission to view it.

Searching for abandoned resource strings…
cannot read file!!! : Error Domain=NSCocoaErrorDomain Code=257 "The file “xxxx” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/Users/myname/Documents/MyProject/Pods/xxxxxx.swift, NSUnderlyingError=0x7f8afd9f3e10 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

I tryid every thing I could think of :
chmod X on AbandonString.swift
chmod -R 777 on project folder
and execute command with "sudo"

🤷‍♂️

Thanks for help.

Can't run with `./AbandonedStrings <project-folder-path>`

I Can't run with ./AbandonedStrings <project-folder-path>.
I need to use ./AbandonedStrings/main.swift <project-folder-path> instead, with chmod to add execution permission. May be we can update the README to better capture this issue.

Crash due to force unwrapping

Seeing quite a few crashes here: let endIndex = lineWithoutFirstQuote.index(of:"\"")!

It would be best to remove all force unwrapping and make functions like extractStringIdentifierFromTrimmedLine return optional strings.

utf16

Been trying to hand prune our localization files, but they have over 2k strings from over seven years. Tried this out and it didn't find anything abandoned.

Turns out contentsOfFile is reading the strings file using utf8 encoding and our files are utf16. This causes the try to fail and an empty string returned instead of file contents.

Found something mentioned on SO that as of 2016 Apple is using utf8, but a new localization I created yesterday is utf16 as well.

Maybe consider a warning in contentsOfFile catch?

Use stdout and stderr for output

Right now project isn't writing to stdout and stderr so this won't work:

./AbandonedStrings /path/to/project > outputfile.txt

No results when '.strings' files are not UTF8 encoded

Don't know if you've had this problem, but I got no results running abandoned-strings on my source. Turned out it was thecontentsOfFile method failing due to the encoding of the .strings files not being UTF8 encoded.
I changed the method thusly to fix it.

func contentsOfFile(filePath: String) -> String {
    do {
        let usedEncoding = UnsafeMutablePointer<NSStringEncoding>()
        return try String(contentsOfFile: filePath, usedEncoding: usedEncoding)
    }
    catch { return "" }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.