ive think i remeber seeing this question crop up on here not long ago,
there are two similar ways to detect wind direction
first idea, in theory parachutes are effected by wind direction so put one high up and compare its position a few moments later, do the appropriate maths and im sure you'll get your wind direction
Another idea is use the
drop command to create a particle, particles i believe are more obviously effected by wind, compare its position like a second or two later and apply the same maths to calculate the angle it moved