blob: c540e919630567661c19ff3e6889296447498c74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import qbs.File
import qbs.TemporaryDir
Product {
targetName: {
var dir;
var dirPath;
try {
dir = new TemporaryDir();
dirPath = dir.path();
if (!dirPath)
throw "path is empty";
if (!dir.isValid())
throw "dir is not valid";
if (!File.exists(dirPath))
throw "dir does not exist";
} finally {
if (!dir.remove())
throw "could not remove";
}
if (File.exists(dirPath))
throw "dir was not removed";
}
}
|