When this sketch is launched from the Arduino IDE, the Serial Monitor can be used to change input device. You can enter 0 to change to input from the potentiometer. Entering 1 will switch to input from the photoresistor.
In the deployment configuration, the Arduino in not connected to a computer and has its own power supply. It will read from the photoresistor only and our target is reached.