Coder Social home page Coder Social logo

Comments (9)

ChuckJonas avatar ChuckJonas commented on July 19, 2024

The backup would be nice and allow us to automatically reset on failures (so you aren't left with a bunch of files that sale [delete_me].

Probably would want to make it controllable via a param -b --backup. Not sure if the default would be on or off. (if off we would still use a tmp folder to allow us to restore on failure)

A second command sfdx force:source:clean:undo could be added to undo a successful clean

from force-source-clean.

ChuckJonas avatar ChuckJonas commented on July 19, 2024

maybe the param isn't needed... I guess it would only be if someone didn't want the command creating a .clean.bak file

from force-source-clean.

ralphcallaway avatar ralphcallaway commented on July 19, 2024

i'd vote for it just being used if something went wrong, i.e. if something errors don't put the onus on the user to recover it, but if they just screwed it up (say they ran clean with the wrong org) the onus would be on them to use source control to clean it up ...

from force-source-clean.

ChuckJonas avatar ChuckJonas commented on July 19, 2024

released in 0.0.3

from force-source-clean.

ralphcallaway avatar ralphcallaway commented on July 19, 2024

so how is this working?

was using today and got an error about an unexpected file due to some merge conflict artifacts, but wasn't automatically restored, but maybe there is an extra step?

ran plugins update, and pulled down the latest code for my local version from master, could have messed that up and ended up using an old version

from force-source-clean.

ChuckJonas avatar ChuckJonas commented on July 19, 2024

https://github.com/ChuckJonas/force-source-clean/blob/master/src/commands/force/source/clean.ts#L86

I only did very limited testing, so it's highly possible there is a bug.

Looks like it's only handling errors on the retrieve cmd (the markContents code should also be moved inside the handler), but it sounds like that's where your failure occurred.

Next time, please zip your project so we can reproduce.

You can run sfdx plugins to determine if the plugin is linked via npm or local source (it will say link followed by the path).

from force-source-clean.

ralphcallaway avatar ralphcallaway commented on July 19, 2024

sending you a zip, although fairly easy to reproduce, just copy any class and change to MyClass.cls.orig to mimic a merge artifact

output

➜  example git:(test) ✗ sfdx force:source:clean -x manifest/package.xml -n
(node:30064) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
WARNING: Failed to retrieve! All files are "marked" and will need to be manually reset!
ERROR running force:source:retrieve:  Unexpected file found in package directory: /afolder/aproject/src/main/default/classes/SomeClass.cls.orig

from force-source-clean.

ralphcallaway avatar ralphcallaway commented on July 19, 2024

@ChuckJonas scratch that, the example repo i had was pretty big and was taking forever to upload, a lot easier to just have you copy an apex class and add .orig suffix and then run the command

from force-source-clean.

ChuckJonas avatar ChuckJonas commented on July 19, 2024

@ralphcallaway What do you see when your run sfdx plugins for force-source-clean?

I've tried to repro this with both the steps above and the topcon project (both from source and via the npm install), but can't. Maybe I just don't have the right repo steps...

from force-source-clean.

Related Issues (15)

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.