Posted in the event that the OP (or others) is following this.
In almost every case there is an electrical box that shares a common wall with the closet. Usually this will be a hallway switch, After you take the necessary precautions to shut off power, remove the hallway switch and do one of two things:
1) using the switch circuit add a piece of Romex to power the closet light, do this by running the Romex through the back of the electrical box through to the studs, to a "new work" outlet towards the top of your closet sidewall. One you have fished the Romex, re-secure the hallway switch and the new work box. In this box install your new light. Each time the hallway light comes on your closet is lit. This is ideal for a closet near an entrance as you probably turn on the hallway light each time you enter/leave and access to closet.
2) using the same methodology, install two new work boxes in the closet. One for a light swtich. This switch will draw power from the hall way light but will only be on when you turn the closet light on. Your closet light switch will be in the closet. The second box in the closet is for your light.
I have installed three lights using these techniques, it is vastly superior to any led closet light.
As a side note this also works for powering under cabinet lights in the kitchen. In that case you use a kitchen outlet to power the switch. The only limitation is that the switch must share the same cavity that the outlet shares between any given 2 X 4s